1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-25 11:37:56 +00:00

Re-check the systrace probe ID before calling dtrace_probe().

Otherwise there exists a narrow window during which a syscall probe can be
disabled and cause a concurrently-running thread to call dtrace_probe()
with an invalid probe ID.

Reported by:	ngie
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
This commit is contained in:
Mark Johnston 2016-09-22 23:22:53 +00:00
parent c2625e6e38
commit 36f5d07745
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=306220

View File

@ -193,7 +193,8 @@ systrace_probe(struct syscall_args *sa, enum systrace_probe_t type, int retval)
memset(uargs, 0, sizeof(uargs));
if (type == SYSTRACE_ENTRY) {
id = sa->callp->sy_entry;
if ((id = sa->callp->sy_entry) == DTRACE_IDNONE)
return;
if (sa->callp->sy_systrace_args_func != NULL)
/*
@ -215,7 +216,8 @@ systrace_probe(struct syscall_args *sa, enum systrace_probe_t type, int retval)
*/
curthread->t_dtrace_systrace_args = uargs;
} else {
id = sa->callp->sy_return;
if ((id = sa->callp->sy_return) == DTRACE_IDNONE)
return;
curthread->t_dtrace_systrace_args = NULL;
/* Set arg0 and arg1 as the return value of this syscall. */