[U-Boot] [PATCH 0/2] Deprecate Linux bootargs munging with CONFIG_SILENT_CONSOLE.

Wolfgang Denk wd at denx.de
Tue Jan 10 23:41:34 CET 2012


Dear Doug Anderson,

In message <CAD=FV=VX-BEpx2idRA1T1sBt2H6n9vYayTb1HYtNjjTnA_zziA at mail.gmail.com> you wrote:
> Dear Wolfgang Denk,
> 
> On Tue, Jan 10, 2012 at 2:16 PM, Wolfgang Denk <wd at denx.de> wrote:
> > In which way would this approach avoid the problem (potential overflow
> > of cmdline max size) that you are trying to fix with your patch?
> 
> The overflow will be avoided on any boards that don't define
> CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE.  As of the third version of
> this patch (will be sent shortly), the Blackfin board will be fixed so
> that the overflow can't happen on that board.

You misunderstand.

I agree that the code should be fixed to not write out of the bouds of
the array.  But simply increasing the buffer size here in U-Boot only
means that you will have an overflow or at least a truncation on many
Linux systems.

> > So you actually do not fix any problem, but you remove existing
> > functionality that has been used in a number of projects, so you
> > actually break a number of boards.
> 
> With the third version of this patch the Blackfin board is one example
> of a board that is fixed.  On all other boards, no functionality is
> lost and no bugs are fixed.

If we don't change functionality and don;t fix any bugs then we can
simply omit this change?


> Previously I had submitted a patch to fix the overflow itself, which
> you NAKed (saying that fixup_silent_linux() was deprecated and
> shouldn't get any bugfixes).  I am happy to dig that up and re-post it
> if you'd prefer.  Either option is fine with me.

I agree with Mike that the existing code is anything but perfect, but
removing useful functionality without providing something that is at
least as good makes no sense to me.

With your patches we get more and uglier code and win nothing.

> My problem is that I have a board that would like to use
> CONFIG_SILENT_CONSOLE (to silence the U-Boot console) and have a Linux
> command line that is >256 characters.  I either need the overflow
> fixed (my previous patch) or some way to avoid it (this patch).

Use a shorter command line? ;-)

See my previous message - the command line size is hardwired to 256
bytes for a number of architectures.  You break these.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Even if you aren't in doubt, consider the mental welfare of the  per-
son who has to maintain the code after you, and who will probably put
parens in the wrong place.          - Larry Wall in the perl man page


More information about the U-Boot mailing list