Bug#671589: bootlog does not work if the kernel boot command line is too long

Dmitry Bogatov KAction at debian.org
Sat Dec 29 18:34:35 GMT 2018


control: tags -1 +confirmed +upstream

Jesse, can you please take a look? While I believe that 4Kb for kernel
command line is enough, you might prefer to use getline(3).

As I can see bootlogd.c already uses stdio.h, but is malloc-free. Use of
getline(3) would break this wonderful propery :(

[2012-05-04 19:41] Marc MERLIN <marc_soft at merlins.org>
>
> part       text/plain                1204
> Package: initscripts
> Version: 2.88dsf-13.1
> 
> Courtesy of Maciej Zenczykowski:
> 
> sysvinit - kernel command lines can be longer than 256 characters. 
> 
> Fix a bug where a kernel commandline option of 'console=ttyS0,115200n8'
> was not being parsed correctly by bootlogd because it was 253 bytes into
> the string, and thus would get truncated by a 255-byte read into the 256
> byte buffer. This results in bootlogd not seeing the console=ttyS0 kernel
> parameter, and it effectively turns off the serial console.
> 
> --- /tmp/g4-4428/cache/modules/sysvinit/src/src/bootlogd.c#2       2011-04-11 15:10:58.000000000 -0700
> +++ /tmp/g4-4428/29844861/modules/sysvinit/src/src/bootlogd.c      2012-05-04 19:40:37.000000000 -0700
> @@ -244,7 +244,7 @@
>         unsigned int    kdev;
>  #endif
>         struct stat     st, st2;
> -       char            buf[256];
> +       char            buf[4096];
>         char            *p;
>         int             didmount = 0;
>         int             n, r;
> 
> -- 
> "A mouse is a device used to point at the xterm you want to type in" - A.S.R.
> Microsoft is to operating systems ....
>                                       .... what McDonalds is to gourmet cooking
> Home page: http://marc.merlins.org/  
> 
> 



More information about the Debian-init-diversity mailing list