Home Home > GIT Browse > SLE15
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Mladek <pmladek@suse.com>2018-07-09 15:16:18 +0200
committerPetr Mladek <pmladek@suse.com>2018-07-10 11:22:00 +0200
commit33a00bff67ed99767ab919668077af1fb81e0c0d (patch)
treee3bca9fa757878d902dccc674dba5220c4bc53d7
parent08767e84b9c17fa17b4b0f26b36c6aaec2d2a314 (diff)
printk: fix possible reuse of va_list variable (bsc#1100602).
-rw-r--r--kernel/printk/printk_safe.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/printk/printk_safe.c b/kernel/printk/printk_safe.c
index 033e50a7d706..cdf40047aa2a 100644
--- a/kernel/printk/printk_safe.c
+++ b/kernel/printk/printk_safe.c
@@ -85,6 +85,7 @@ static int printk_safe_log_store(struct printk_safe_seq_buf *s,
{
int add;
size_t len;
+ va_list ap;
again:
len = atomic_read(&s->len);
@@ -103,7 +104,9 @@ again:
if (!len)
smp_rmb();
- add = vscnprintf(s->buffer + len, sizeof(s->buffer) - len, fmt, args);
+ va_copy(ap, args);
+ add = vscnprintf(s->buffer + len, sizeof(s->buffer) - len, fmt, ap);
+ va_end(ap);
if (!add)
return 0;