From: Ralf Baechle Date: Sun, 19 Feb 2006 03:42:11 +0000 (+0000) Subject: [MIPS] N32: Make sure pointer is good before passing it to sys_waitid(). X-Git-Tag: v2.6.16-rc5~66^2~8 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f3468e0c34c8de919062582575a01e2434c8e727;p=linux-2.6 [MIPS] N32: Make sure pointer is good before passing it to sys_waitid(). After all we're calling sys_waitid() with fs set to KERNEL_DS ... Signed-off-by: Ralf Baechle --- diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c index 9996b6e845..5f68b220c2 100644 --- a/arch/mips/kernel/linux32.c +++ b/arch/mips/kernel/linux32.c @@ -230,6 +230,9 @@ sysn32_waitid(int which, compat_pid_t pid, long ret; mm_segment_t old_fs = get_fs(); + if (!access_ok(VERIFY_WRITE, uinfo, sizeof(*uinfo))) + return -EFAULT; + set_fs (KERNEL_DS); ret = sys_waitid(which, pid, uinfo, options, uru ? (struct rusage __user *) &ru : NULL);