[LTP] [PATCH] tst_kconfig: Avoid buffer overflow when parsing /proc/cmdline

Petr Vorel pvorel@suse.cz
Wed Jun 19 09:47:03 CEST 2024


> When the test is run with a kernel booting with many parameters, the
> buffer size is often not large enough to store the complete command
> line. This results in a buffer overflow and the test complains with
> the following message:

>   tst_kconfig.c:609: TWARN: Buffer overflowed while parsing /proc/cmdline

Thanks for the fix!

Reviewed-by: Petr Vorel <pvorel@suse.cz>
Fixes: 180834982 ("kconfig: add funtion to parse /proc/cmdline")

NOTE tst_kconfig_read() has char line[128], also struct tst_kcmdline_var member
has this length. The longest line on some on my systems is 109, it's still OK,
hopefully it stays :).

Kind regards,
Petr


More information about the ltp mailing list