lkml.org 
[lkml]   [2018]   [Jan]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 03/10] ip_rt_ioctl(): take copyin to caller
>  	case SIOCGSTAMP:
> @@ -884,8 +885,12 @@ int inet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
> break;
> case SIOCADDRT:
> case SIOCDELRT:
> + if (copy_from_user(&rt, p, sizeof(struct rtentry)))
> + return -EFAULT;
> + err = ip_rt_ioctl(net, cmd, &rt);
> + break;
> case SIOCRTMSG:
> - err = ip_rt_ioctl(net, cmd, (void __user *)arg);
> + err = -EINVAL;

This looks odd, but ip_rt_ioctl never handled SIOCRTMSG to start with,
so it looks fine. Might be worth splitting into another prep patch
with a good changelog.

ip_rt_ioctl could also use some additional simplification if it's only
called for SIOCADDRT/SIOCDELRT and lose a level of indentation while
we're at it.

But otherwise this looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

\
 
 \ /
  Last update: 2018-01-22 17:43    [W:0.123 / U:0.412 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site