Skip to content

Commit

Permalink
[NET]: Do not leak MSG_CMSG_COMPAT into userspace.
Browse files Browse the repository at this point in the history
Noticed by Sridhar Samudrala.

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Sep 16, 2005
1 parent 065d9ca commit 37f7f42
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 37f7f42

Please sign in to comment.