From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roland McGrath Subject: [PATCH] sys_waitid: return -EFAULT for NULL Date: Tue, 13 Jan 2009 14:49:41 -0800 (PST) Message-ID: <20090113224941.36F19FC3DD@magilla.sf.frob.com> References: <20090113224759.7DFB7FC3DD@magilla.sf.frob.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Roland McGrath's message of Tuesday, 13 January 2009 14:47:59 -0800 <20090113224759.7DFB7FC3DD-nL1rrgvulkc2UH6IwYuUx0EOCMrvLtNR@public.gmane.org> Sender: linux-man-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Linus Torvalds , Andrew Morton Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, kernel list , Ulrich Drepper , Vegard Nossum , "linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" List-Id: linux-man@vger.kernel.org It's always been invalid to call waitid() with a NULL pointer. It was an oversight that it was allowed (and acts like a wait4() call instead). Signed-off-by: Roland McGrath --- kernel/exit.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/kernel/exit.c b/kernel/exit.c index c7740fa..fa25790 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -1760,6 +1760,8 @@ asmlinkage long sys_waitid(int which, pid_t upid, enum pid_type type; long ret; + if (unlikely(!infop)) + return -EFAULT; if (options & ~(WNOHANG|WNOWAIT|WEXITED|WSTOPPED|WCONTINUED)) return -EINVAL; if (!(options & (WEXITED|WSTOPPED|WCONTINUED))) -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html