summaryrefslogtreecommitdiff
path: root/arch/arm64
diff options
context:
space:
mode:
authorPatrick Fay <pfay@codeaurora.org>2017-06-19 20:20:40 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2017-06-27 15:54:22 -0700
commit8fc0a6808af0925e3ed0f6815f04e3c57ad7b271 (patch)
treeff57436bffc2542bb8bd6bf0b750f289e831d877 /arch/arm64
parent35589846a02122d17cd8703ed6a642cdc4918621 (diff)
Perf: arm64: avoid use of uninitialized variable
Variable "buf" is not initialized. It may contain the data from stack when "count == 0". Kernel information leak is possible due to different code path execution. Change-Id: I041b2e7262f7f66a9b039c0f0591bbb1fc9e4890 Signed-off-by: Patrick Fay <pfay@codeaurora.org>
Diffstat (limited to 'arch/arm64')
-rw-r--r--arch/arm64/kernel/perf_trace_counters.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/arm64/kernel/perf_trace_counters.c b/arch/arm64/kernel/perf_trace_counters.c
index 748ad449fc18..dc92b29ac103 100644
--- a/arch/arm64/kernel/perf_trace_counters.c
+++ b/arch/arm64/kernel/perf_trace_counters.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2013-2014, 2017 The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -124,6 +124,7 @@ static ssize_t write_enabled_perftp_file_bool(struct file *file,
char buf[32];
size_t buf_size;
+ buf[0] = 0;
buf_size = min(count, (sizeof(buf)-1));
if (copy_from_user(buf, user_buf, buf_size))
return -EFAULT;