Date: Sat, 15 Jul 2017 15:08:18 +0000 (UTC) From: Dmitry Chagin <dchagin@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321012 - stable/10/sys/compat/linux Message-ID: <201707151508.v6FF8IbP004444@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dchagin Date: Sat Jul 15 15:08:18 2017 New Revision: 321012 URL: https://svnweb.freebsd.org/changeset/base/321012 Log: MFC r292744: Return EINVAL in case of incorrect sigev_signo value specified instead of panicing. Modified: stable/10/sys/compat/linux/linux_timer.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_timer.c ============================================================================== --- stable/10/sys/compat/linux/linux_timer.c Sat Jul 15 15:00:13 2017 (r321011) +++ stable/10/sys/compat/linux/linux_timer.c Sat Jul 15 15:08:18 2017 (r321012) @@ -57,6 +57,8 @@ linux_convert_l_sigevent(struct l_sigevent *l_sig, str 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, str 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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201707151508.v6FF8IbP004444>