summaryrefslogtreecommitdiffstats
path: root/sys/compat
diff options
context:
space:
mode:
authordchagin <dchagin@FreeBSD.org>2015-12-26 09:09:49 +0000
committerdchagin <dchagin@FreeBSD.org>2015-12-26 09:09:49 +0000
commit4d7095f5fe33b9293909aac69f25a3b52adb8c72 (patch)
treeaedddf66eb430af2e260cd529b74d705a06a05bb /sys/compat
parent4beab3b76259d4ee784108fd13fc7f47f4124a93 (diff)
downloadFreeBSD-src-4d7095f5fe33b9293909aac69f25a3b52adb8c72.zip
FreeBSD-src-4d7095f5fe33b9293909aac69f25a3b52adb8c72.tar.gz
Return EINVAL in case of incorrect sigev_signo value specified instead of panicing.
Diffstat (limited to 'sys/compat')
-rw-r--r--sys/compat/linux/linux_timer.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/compat/linux/linux_timer.c b/sys/compat/linux/linux_timer.c
index 7dbddbe..f2819bb 100644
--- a/sys/compat/linux/linux_timer.c
+++ b/sys/compat/linux/linux_timer.c
@@ -57,6 +57,8 @@ linux_convert_l_sigevent(struct l_sigevent *l_sig, struct sigevent *sig)
CP(*l_sig, *sig, sigev_notify);
switch (l_sig->sigev_notify) {
case L_SIGEV_SIGNAL:
+ if (!LINUX_SIG_VALID(l_sig->sigev_signo))
+ return (EINVAL);
sig->sigev_notify = SIGEV_SIGNAL;
sig->sigev_signo = linux_to_bsd_signal(l_sig->sigev_signo);
PTRIN_CP(*l_sig, *sig, sigev_value.sival_ptr);
@@ -73,6 +75,8 @@ linux_convert_l_sigevent(struct l_sigevent *l_sig, struct sigevent *sig)
return (EINVAL);
#endif
case L_SIGEV_THREAD_ID:
+ if (!LINUX_SIG_VALID(l_sig->sigev_signo))
+ return (EINVAL);
sig->sigev_notify = SIGEV_THREAD_ID;
CP2(*l_sig, *sig, _l_sigev_un._tid, sigev_notify_thread_id);
sig->sigev_signo = linux_to_bsd_signal(l_sig->sigev_signo);
OpenPOWER on IntegriCloud