Skip to content

Commit

Permalink
[SPARC64]: Fix cmsg length checks in Solaris emulation layer.
Browse files Browse the repository at this point in the history
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Jun 21, 2005
1 parent 1d345da commit 8005aba
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions arch/sparc64/solaris/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,10 @@ asmlinkage int solaris_sendmsg(int fd, struct sol_nmsghdr __user *user_msg, unsi
unsigned long *kcmsg;
compat_size_t cmlen;

if(kern_msg.msg_controllen > sizeof(ctl) &&
kern_msg.msg_controllen <= 256) {
if (kern_msg.msg_controllen <= sizeof(compat_size_t))
return -EINVAL;

if(kern_msg.msg_controllen > sizeof(ctl)) {
err = -ENOBUFS;
ctl_buf = kmalloc(kern_msg.msg_controllen, GFP_KERNEL);
if(!ctl_buf)
Expand Down

0 comments on commit 8005aba

Please sign in to comment.