He Zhe
e945325eb7
printk: Fix panic caused by passing log_buf_len to command line
...
commit 277fcdb2cfee38ccdbe07e705dbd4896ba0c9930 upstream.
log_buf_len_setup does not check input argument before passing it to
simple_strtoull. The argument would be a NULL pointer if "log_buf_len",
without its value, is set in command line and thus causes the following
panic.
PANIC: early exception 0xe3 IP 10:ffffffffaaeacd0d error 0 cr2 0x0
[ 0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 4.19.0-rc4-yocto-standard+ #1
[ 0.000000] RIP: 0010:_parse_integer_fixup_radix+0xd/0x70
...
[ 0.000000] Call Trace:
[ 0.000000] simple_strtoull+0x29/0x70
[ 0.000000] memparse+0x26/0x90
[ 0.000000] log_buf_len_setup+0x17/0x22
[ 0.000000] do_early_param+0x57/0x8e
[ 0.000000] parse_args+0x208/0x320
[ 0.000000] ? rdinit_setup+0x30/0x30
[ 0.000000] parse_early_options+0x29/0x2d
[ 0.000000] ? rdinit_setup+0x30/0x30
[ 0.000000] parse_early_param+0x36/0x4d
[ 0.000000] setup_arch+0x336/0x99e
[ 0.000000] start_kernel+0x6f/0x4ee
[ 0.000000] x86_64_start_reservations+0x24/0x26
[ 0.000000] x86_64_start_kernel+0x6f/0x72
[ 0.000000] secondary_startup_64+0xa4/0xb0
This patch adds a check to prevent the panic.
Link: http://lkml.kernel.org/r/1538239553-81805-1-git-send-email-zhe.he@windriver.com
Cc: stable@vger.kernel.org
Cc: rostedt@goodmis.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: He Zhe <zhe.he@windriver.com>
Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-13 11:08:48 -08:00
..
2018-11-13 11:08:28 -08:00
2018-10-04 13:28:08 -07:00
2018-06-15 07:15:28 +09:00
2018-06-12 16:19:22 -07:00
2018-11-13 11:08:17 -08:00
2018-10-02 09:37:59 +02:00
2018-06-08 18:56:02 +09:00
2018-08-13 10:47:26 -07:00
2018-08-20 18:33:50 +02:00
2018-11-13 11:08:20 -08:00
2018-10-12 12:35:02 +02:00
2018-11-13 11:08:48 -08:00
2018-08-13 11:25:07 -07:00
2018-10-16 09:36:01 +02:00
2018-09-06 23:38:35 +02:00
2018-10-19 17:25:11 -04:00
2018-01-04 16:45:09 -08:00
2018-02-06 18:32:44 -08:00
2018-05-18 14:58:22 +02:00
2018-08-17 09:41:28 -07:00
2018-07-18 11:43:36 -04:00
2018-07-17 14:45:08 -04:00
2018-02-23 11:22:22 -05:00
2018-06-19 10:39:54 -04:00
2018-08-15 10:46:54 -07:00
2018-11-13 11:08:47 -08:00
2018-06-24 14:39:47 +02:00
2018-11-13 11:08:19 -08:00
2018-08-22 10:52:47 -07:00
2018-04-27 14:34:51 +02:00
2018-05-16 07:23:35 +02:00
2018-05-16 07:23:35 +02:00
2018-07-21 12:57:35 -05:00
2018-02-21 16:54:06 +01:00
2018-06-21 12:33:19 +02:00
2018-09-04 16:45:02 -07:00
2018-08-06 12:35:20 +02:00
2018-08-20 18:23:00 +02:00
2017-12-14 16:00:49 -08:00
2018-08-22 10:52:47 -07:00
2018-05-15 23:08:33 -07:00
2018-01-08 19:43:15 +01:00
2018-09-10 10:15:48 +02:00
2018-08-14 19:12:29 -03:00
2018-08-02 08:06:54 +09:00
2018-06-15 07:55:24 +09:00
2018-06-15 07:55:24 +09:00
2018-06-12 16:19:22 -07:00
2018-07-16 12:31:57 -07:00
2018-11-13 11:08:28 -08:00
2018-08-13 11:25:07 -07:00
2018-07-18 01:18:05 +09:00
2018-08-25 18:43:59 -07:00
2018-07-02 11:36:17 +02:00
2018-07-02 11:36:17 +02:00
2018-08-22 10:52:47 -07:00
2018-01-05 18:43:00 +11:00
2018-06-14 12:21:18 +09:00
2018-04-11 10:28:37 -07:00
2018-04-03 19:15:32 -07:00
2018-09-20 22:01:11 +02:00
2018-02-06 18:32:46 -08:00
2018-08-06 12:35:20 +02:00
2018-06-15 07:55:24 +09:00
2018-06-08 17:21:52 -07:00
2018-07-10 22:18:52 +02:00
2018-06-06 16:34:00 -07:00
2018-11-13 11:08:45 -08:00
2018-08-07 12:25:30 +02:00
2018-07-03 09:20:44 +02:00
2018-08-03 15:52:10 +02:00
2018-08-13 11:25:07 -07:00
2018-06-10 10:17:09 -07:00
2018-09-20 22:01:11 +02:00
2018-04-16 11:26:49 +02:00
2018-08-23 18:48:43 -07:00
2017-12-17 13:57:15 +01:00
2018-02-06 18:32:46 -08:00
2018-06-21 12:33:05 +02:00
2018-06-25 11:30:10 -07:00
2018-10-17 15:35:29 -04:00
2018-04-05 21:36:27 -07:00
2018-04-02 20:15:59 +02:00
2018-04-02 20:15:30 +02:00
2018-06-07 16:56:28 -04:00
2018-08-11 02:05:53 -05:00
2018-08-22 10:52:47 -07:00
2018-08-11 02:05:53 -05:00
2018-04-11 10:28:35 -07:00
2018-08-30 12:56:40 +02:00
2018-08-30 12:56:40 +02:00
2018-05-18 08:47:13 -07:00
2018-08-30 12:56:40 +02:00