This is a note to let you know that I've just added the patch titled printk: handle blank console arguments passed in. to the 4.19-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: printk-handle-blank-console-arguments-passed-in.patch and it can be found in the queue-4.19 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 702cec586f6ee210213b0a6ba629230b8b8af02c Author: Shreyas Joshi <shreyas.joshi@xxxxxxxxx> Date: Fri May 22 16:53:06 2020 +1000 printk: handle blank console arguments passed in. [ Upstream commit 48021f98130880dd74286459a1ef48b5e9bc374f ] If uboot passes a blank string to console_setup then it results in a trashed memory. Ultimately, the kernel crashes during freeing up the memory. This fix checks if there is a blank parameter being passed to console_setup from uboot. In case it detects that the console parameter is blank then it doesn't setup the serial device and it gracefully exits. Link: https://lore.kernel.org/r/20200522065306.83-1-shreyas.joshi@xxxxxxxxx Signed-off-by: Shreyas Joshi <shreyas.joshi@xxxxxxxxx> Acked-by: Sergey Senozhatsky <sergey.senozhatsky@xxxxxxxxx> [pmladek@xxxxxxxx: Better format the commit message and code, remove unnecessary brackets.] Signed-off-by: Petr Mladek <pmladek@xxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index 3cb0e5b479ff3..cf272aba362be 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -2148,6 +2148,9 @@ static int __init console_setup(char *str) char *s, *options, *brl_options = NULL; int idx; + if (str[0] == 0) + return 1; + if (_braille_console_setup(&str, &brl_options)) return 1;