net: socket: make bond ioctls go through compat_ifreq_ioctl()
authorJohannes Berg <johannes.berg@intel.com>
Fri, 25 Jan 2019 21:43:20 +0000 (22:43 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 30 Jan 2019 18:19:31 +0000 (10:19 -0800)
Same story as before, these use struct ifreq and thus need
to be read with the shorter version to not cause faults.

Cc: stable@vger.kernel.org
Fixes: f92d4fc95341 ("kill bond_ioctl()")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/socket.c

index 473ac8d7c54e18032a959fe3fb19d15b3d8405a5..d80d87a395ea99c58624feb204c896e697140bfa 100644 (file)
@@ -3258,16 +3258,16 @@ static int compat_sock_ioctl_trans(struct file *file, struct socket *sock,
        case SIOCGMIIPHY:
        case SIOCGMIIREG:
        case SIOCSMIIREG:
+       case SIOCBONDENSLAVE:
+       case SIOCBONDRELEASE:
+       case SIOCBONDSETHWADDR:
+       case SIOCBONDCHANGEACTIVE:
                return compat_ifreq_ioctl(net, sock, cmd, argp);
 
        case SIOCSARP:
        case SIOCGARP:
        case SIOCDARP:
        case SIOCATMARK:
-       case SIOCBONDENSLAVE:
-       case SIOCBONDRELEASE:
-       case SIOCBONDSETHWADDR:
-       case SIOCBONDCHANGEACTIVE:
                return sock_do_ioctl(net, sock, cmd, arg);
        }