summaryrefslogtreecommitdiffstats
path: root/net/socket.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2019-01-25 16:43:19 -0500
committerDavid S. Miller <davem@davemloft.net>2019-01-30 13:19:31 -0500
commitc6c9fee35dc27362b7bac34b2fc9f5b8ace2e22c (patch)
treef21b9ab160102971f554119849f23ee8cba11af6 /net/socket.c
parent37ac39bdddc528c998a9f36db36937de923fdf2a (diff)
net: socket: fix SIOCGIFNAME in compat
As reported by Robert O'Callahan in https://bugzilla.kernel.org/show_bug.cgi?id=202273 reverting the previous changes in this area broke the SIOCGIFNAME ioctl in compat again (I'd previously fixed it after his previous report of breakage in https://bugzilla.kernel.org/show_bug.cgi?id=199469). This is obviously because I fixed SIOCGIFNAME more or less by accident. Fix it explicitly now by making it pass through the restored compat translation code. Cc: stable@vger.kernel.org Fixes: 4cf808e7ac32 ("kill dev_ifname32()") Reported-by: Robert O'Callahan <robert@ocallahan.org> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/socket.c')
-rw-r--r--net/socket.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/socket.c b/net/socket.c
index fbf80f9fb057..473ac8d7c54e 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -3029,6 +3029,7 @@ static int compat_ifreq_ioctl(struct net *net, struct socket *sock,
3029 case SIOCGIFTXQLEN: 3029 case SIOCGIFTXQLEN:
3030 case SIOCGMIIPHY: 3030 case SIOCGMIIPHY:
3031 case SIOCGMIIREG: 3031 case SIOCGMIIREG:
3032 case SIOCGIFNAME:
3032 if (copy_in_user(uifr32, uifr, sizeof(*uifr32))) 3033 if (copy_in_user(uifr32, uifr, sizeof(*uifr32)))
3033 err = -EFAULT; 3034 err = -EFAULT;
3034 break; 3035 break;
@@ -3252,6 +3253,7 @@ static int compat_sock_ioctl_trans(struct file *file, struct socket *sock,
3252 case SIOCSIFTXQLEN: 3253 case SIOCSIFTXQLEN:
3253 case SIOCBRADDIF: 3254 case SIOCBRADDIF:
3254 case SIOCBRDELIF: 3255 case SIOCBRDELIF:
3256 case SIOCGIFNAME:
3255 case SIOCSIFNAME: 3257 case SIOCSIFNAME:
3256 case SIOCGMIIPHY: 3258 case SIOCGMIIPHY:
3257 case SIOCGMIIREG: 3259 case SIOCGMIIREG:
@@ -3266,7 +3268,6 @@ static int compat_sock_ioctl_trans(struct file *file, struct socket *sock,
3266 case SIOCBONDRELEASE: 3268 case SIOCBONDRELEASE:
3267 case SIOCBONDSETHWADDR: 3269 case SIOCBONDSETHWADDR:
3268 case SIOCBONDCHANGEACTIVE: 3270 case SIOCBONDCHANGEACTIVE:
3269 case SIOCGIFNAME:
3270 return sock_do_ioctl(net, sock, cmd, arg); 3271 return sock_do_ioctl(net, sock, cmd, arg);
3271 } 3272 }
3272 3273