Re: [PATCH] printk: fix possible reuse of va_list variable

From: Petr Mladek
Date: Thu May 17 2018 - 07:01:04 EST


On Fri 2018-05-11 20:02:31, Tetsuo Handa wrote:
> >From 766cf72b5fdc00d1cf5a8ca2c6b23ebb75e2b4d4 Mon Sep 17 00:00:00 2001
> From: Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx>
> Date: Fri, 11 May 2018 19:54:19 +0900
> Subject: [PATCH] printk: fix possible reuse of va_list variable
>
> I noticed that there is a possibility that printk_safe_log_store() causes
> kernel oops because "args" parameter is passed to vsnprintf() again when
> atomic_cmpxchg() detected that we raced. Fix this by using va_copy().

Great catch!

Reviewed-by: Petr Mladek <pmladek@xxxxxxxx>

I have tagged it for stable and pushed into printk.git,
branch for-4.18, see
https://git.kernel.org/pub/scm/linux/kernel/git/pmladek/printk.git/commit/?h=for-4.18&id=988a35f8da1dec5a8cd2788054d1e717be61bf25

Best Regards,
Petr