[SPARC64]: Fix cmsg length checks in Solaris emulation layer.
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
1d345dac1f
commit
8005aba69a
@ -317,8 +317,10 @@ asmlinkage int solaris_sendmsg(int fd, struct sol_nmsghdr __user *user_msg, unsi
|
|||||||
unsigned long *kcmsg;
|
unsigned long *kcmsg;
|
||||||
compat_size_t cmlen;
|
compat_size_t cmlen;
|
||||||
|
|
||||||
if(kern_msg.msg_controllen > sizeof(ctl) &&
|
if (kern_msg.msg_controllen <= sizeof(compat_size_t))
|
||||||
kern_msg.msg_controllen <= 256) {
|
return -EINVAL;
|
||||||
|
|
||||||
|
if(kern_msg.msg_controllen > sizeof(ctl)) {
|
||||||
err = -ENOBUFS;
|
err = -ENOBUFS;
|
||||||
ctl_buf = kmalloc(kern_msg.msg_controllen, GFP_KERNEL);
|
ctl_buf = kmalloc(kern_msg.msg_controllen, GFP_KERNEL);
|
||||||
if(!ctl_buf)
|
if(!ctl_buf)
|
||||||
|
Loading…
Reference in New Issue
Block a user