From 2d864174107380d9c7d2b8c783410a484b925bff Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Fri, 22 Aug 2014 07:52:47 +0000 Subject: [PATCH] Check the validity of struct sigaction sa_flags value, reject unknown flags. Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/kern/kern_sig.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 561ea0a125b7..31070f5e48ed 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -639,6 +639,10 @@ kern_sigaction(td, sig, act, oact, flags) if (!_SIG_VALID(sig)) return (EINVAL); + if (act != NULL && (act->sa_flags & ~(SA_ONSTACK | SA_RESTART | + SA_RESETHAND | SA_NOCLDSTOP | SA_NODEFER | SA_NOCLDWAIT | + SA_SIGINFO)) != 0) + return (EINVAL); PROC_LOCK(p); ps = p->p_sigacts;