From: David S. Miller Date: Fri, 16 Sep 2005 23:51:01 +0000 (-0700) Subject: [NET]: Do not leak MSG_CMSG_COMPAT into userspace. X-Git-Tag: v2.6.14-rc2~5^2~8^2~11 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=37f7f421cce13435fdc0d870caf51141e5ebf079;p=linux-2.6-omap-h63xx.git [NET]: Do not leak MSG_CMSG_COMPAT into userspace. Noticed by Sridhar Samudrala. Signed-off-by: David S. Miller --- diff --git a/net/socket.c b/net/socket.c index c699e93c33d..f9264472377 100644 --- a/net/socket.c +++ b/net/socket.c @@ -1862,7 +1862,8 @@ asmlinkage long sys_recvmsg(int fd, struct msghdr __user *msg, unsigned int flag if (err < 0) goto out_freeiov; } - err = __put_user(msg_sys.msg_flags, COMPAT_FLAGS(msg)); + err = __put_user((msg_sys.msg_flags & ~MSG_CMSG_COMPAT), + COMPAT_FLAGS(msg)); if (err) goto out_freeiov; if (MSG_CMSG_COMPAT & flags)