[NET]: Do not leak MSG_CMSG_COMPAT into userspace.

Noticed by Sridhar Samudrala.

Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
David S. Miller 2005-09-16 16:51:01 -07:00
parent 065d9cac98
commit 37f7f421cc
1 changed files with 2 additions and 1 deletions

View File

@ -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)