summaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorPunit Agrawal <punitagrawal@gmail.com>2021-09-14 23:38:37 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-11-17 09:48:36 +0100
commita993159a2ad02d6baf1b9b76d9ba9fad37c2f53c (patch)
treeee48a63bcb214c7aa1c7e9f2c9cf4ec44409ab5f /crypto
parent71411bd79e2468a08cc2d72394bb02dc3ef193bc (diff)
kprobes: Do not use local variable when creating debugfs file
[ Upstream commit 8f7262cd66699a4b02eb7549b35c81b2116aad95 ] debugfs_create_file() takes a pointer argument that can be used during file operation callbacks (accessible via i_private in the inode structure). An obvious requirement is for the pointer to refer to valid memory when used. When creating the debugfs file to dynamically enable / disable kprobes, a pointer to local variable is passed to debugfs_create_file(); which will go out of scope when the init function returns. The reason this hasn't triggered random memory corruption is because the pointer is not accessed during the debugfs file callbacks. Since the enabled state is managed by the kprobes_all_disabled global variable, the local variable is not needed. Fix the incorrect (and unnecessary) usage of local variable during debugfs_file_create() by passing NULL instead. Link: https://lkml.kernel.org/r/163163031686.489837.4476867635937014973.stgit@devnote2 Fixes: bf8f6e5b3e51 ("Kprobes: The ON/OFF knob thru debugfs") Signed-off-by: Punit Agrawal <punitagrawal@gmail.com> Acked-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'crypto')
0 files changed, 0 insertions, 0 deletions