Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bd56c0a6 authored by Patrick Fay's avatar Patrick Fay
Browse files

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: default avatarPatrick Fay <pfay@codeaurora.org>
parent 827c6ada
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
/* 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;