Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Mar 2012 13:33:15 -0500
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        John Baldwin <jhb@freebsd.org>
Cc:        svn-src-projects@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r232711 - in projects/bigbb: share/mk sys/boot/i386/boot2 sys/boot/pc98/boot2
Message-ID:  <201203091333.16842.jkim@FreeBSD.org>
In-Reply-To: <201203090845.50785.jhb@freebsd.org>
References:  <201203090053.q290rtM2072532@svn.freebsd.org> <201203090845.50785.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Friday 09 March 2012 08:45 am, John Baldwin wrote:
> On Thursday, March 08, 2012 7:53:55 pm Jung-uk Kim wrote:
> > Author: jkim
> > Date: Fri Mar  9 00:53:54 2012
> > New Revision: 232711
> > URL: http://svn.freebsd.org/changeset/base/232711
> >
> > Log:
> >   Spread more shrink ray on boot2.
> >
> >   Submitted by:	dim
> >
> > Modified:
> >   projects/bigbb/share/mk/bsd.sys.mk
> >   projects/bigbb/sys/boot/i386/boot2/Makefile
> >   projects/bigbb/sys/boot/i386/boot2/boot2.c
> >   projects/bigbb/sys/boot/pc98/boot2/Makefile
> >
> > Modified: projects/bigbb/sys/boot/i386/boot2/boot2.c
>
> ===================================================================
>===========
>
> > --- projects/bigbb/sys/boot/i386/boot2/boot2.c	Fri Mar  9
> > 00:28:28 2012
>
> (r232710)
>
> > +++ projects/bigbb/sys/boot/i386/boot2/boot2.c	Fri Mar  9
> > 00:53:54 2012
>
> (r232711)
>
> > @@ -148,8 +148,8 @@ static int xputc(int);
> >  static int xgetc(int);
> >  static inline int getc(int);
> >
> > -static void memcpy(void *, const void *, int);
> > -static void
> > +static __noinline void memcpy(void *, const void *, int);
> > +static __noinline void
> >  memcpy(void *dst, const void *src, int len)
> >  {
> >      const char *s = src;
> > @@ -223,10 +223,7 @@ main(void)
> >  {
> >      uint8_t autoboot;
> >      ino_t ino;
> > -    size_t nbyte;
> >
> > -    opts = 0;
> > -    kname = NULL;
> >      dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000)
> > - __base); v86.ctl = V86_FLAGS;
> >      v86.efl = PSL_RESERVED_DEFAULT | PSL_I;
> > @@ -242,10 +239,8 @@ main(void)
> >      autoboot = 1;
> >
> >      if ((ino = lookup(PATH_CONFIG)) ||
> > -        (ino = lookup(PATH_DOTCONFIG))) {
> > -	nbyte = fsread(ino, cmd, sizeof(cmd) - 1);
> > -	cmd[nbyte] = '\0';
> > -    }
> > +        (ino = lookup(PATH_DOTCONFIG)))
> > +	fsread(ino, cmd, sizeof(cmd) - 1);
>
> These changes will all break functionality.  The bss for boot2 is
> not cleared automatically (see note in revision log for 219452). 
> That means you can end up with garbage in kname or opts, and the
> parse() routine relies on the string stored in cmd[] being
> nul-terminated.

Ah, you're right.  Fixed in r232736-232737.

Thanks!

Jung-uk Kim



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201203091333.16842.jkim>