mirror of https://gitee.com/openkylin/linux.git
Andrea Righi fixed a NULL pointer dereference in trace_kprobe_create()
It is possible to trigger a NULL pointer dereference by writing an incorrectly formatted string to the krpobe_events file. -----BEGIN PGP SIGNATURE----- iIoEABYIADIWIQRRSw7ePDh/lE+zeZMp5XQQmuv6qgUCXD4L1RQccm9zdGVkdEBn b29kbWlzLm9yZwAKCRAp5XQQmuv6qsv7AP9nzekt94AQC2t5OQ38ph/nYGBjLc3T yLqFMshqUSgyVAEAgFB88fvniwLOMFyAqbfRb0+4mq1SDeThBY7TtJBzSQI= =+Pyh -----END PGP SIGNATURE----- Merge tag 'trace-v5.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull tracing fix from Steven Rostedt: "Andrea Righi fixed a NULL pointer dereference in trace_kprobe_create() It is possible to trigger a NULL pointer dereference by writing an incorrectly formatted string to the krpobe_events file" * tag 'trace-v5.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: tracing/kprobes: Fix NULL pointer dereference in trace_kprobe_create()
This commit is contained in:
commit
7939f8beec
|
@ -607,11 +607,17 @@ static int trace_kprobe_create(int argc, const char *argv[])
|
||||||
char buf[MAX_EVENT_NAME_LEN];
|
char buf[MAX_EVENT_NAME_LEN];
|
||||||
unsigned int flags = TPARG_FL_KERNEL;
|
unsigned int flags = TPARG_FL_KERNEL;
|
||||||
|
|
||||||
/* argc must be >= 1 */
|
switch (argv[0][0]) {
|
||||||
if (argv[0][0] == 'r') {
|
case 'r':
|
||||||
is_return = true;
|
is_return = true;
|
||||||
flags |= TPARG_FL_RETURN;
|
flags |= TPARG_FL_RETURN;
|
||||||
} else if (argv[0][0] != 'p' || argc < 2)
|
break;
|
||||||
|
case 'p':
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return -ECANCELED;
|
||||||
|
}
|
||||||
|
if (argc < 2)
|
||||||
return -ECANCELED;
|
return -ECANCELED;
|
||||||
|
|
||||||
event = strchr(&argv[0][1], ':');
|
event = strchr(&argv[0][1], ':');
|
||||||
|
|
Loading…
Reference in New Issue