tracing/uprobe_event: Fix strncpy corner case
authorMasami Hiramatsu <mhiramat@kernel.org>
Tue, 10 Apr 2018 12:20:08 +0000 (21:20 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 May 2018 08:10:31 +0000 (10:10 +0200)
commitbd05324cdd3aaf5364f317d9f074b681127b2adf
tree53fdd599f7c8755ddeaf645305a22cd41dcddcd7
parentbb0b090d836a40c310be1ceb4402835157896c11
tracing/uprobe_event: Fix strncpy corner case

commit 50268a3d266ecfdd6c5873d62b2758d9732fc598 upstream.

Fix string fetch function to terminate with NUL.
It is OK to drop the rest of string.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Song Liu <songliubraving@fb.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: security@kernel.org
Cc: 范龙飞 <long7573@126.com>
Fixes: 5baaa59ef09e ("tracing/probes: Implement 'memory' fetch method for uprobes")
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/trace/trace_uprobe.c