netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: netdev@vger.kernel.org
Cc: Al Viro <viro@zeniv.linux.org.uk>,
	Robert O'Callahan <robert@ocallahan.org>,
	Johannes Berg <johannes.berg@intel.com>
Subject: [PATCH net 3/4] net: socket: fix SIOCGIFNAME in compat
Date: Fri, 25 Jan 2019 22:43:19 +0100	[thread overview]
Message-ID: <20190125214320.17685-4-johannes@sipsolutions.net> (raw)
In-Reply-To: <20190125214320.17685-1-johannes@sipsolutions.net>

From: Johannes Berg <johannes.berg@intel.com>

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>
---
 net/socket.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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,
 		case SIOCGIFTXQLEN:
 		case SIOCGMIIPHY:
 		case SIOCGMIIREG:
+		case SIOCGIFNAME:
 			if (copy_in_user(uifr32, uifr, sizeof(*uifr32)))
 				err = -EFAULT;
 			break;
@@ -3252,6 +3253,7 @@ static int compat_sock_ioctl_trans(struct file *file, struct socket *sock,
 	case SIOCSIFTXQLEN:
 	case SIOCBRADDIF:
 	case SIOCBRDELIF:
+	case SIOCGIFNAME:
 	case SIOCSIFNAME:
 	case SIOCGMIIPHY:
 	case SIOCGMIIREG:
@@ -3266,7 +3268,6 @@ static int compat_sock_ioctl_trans(struct file *file, struct socket *sock,
 	case SIOCBONDRELEASE:
 	case SIOCBONDSETHWADDR:
 	case SIOCBONDCHANGEACTIVE:
-	case SIOCGIFNAME:
 		return sock_do_ioctl(net, sock, cmd, arg);
 	}
 
-- 
2.17.2


  parent reply	other threads:[~2019-01-25 21:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-25 21:43 [PATCH net 0/4] various compat ioctl fixes Johannes Berg
2019-01-25 21:43 ` [PATCH net 1/4] Revert "socket: fix struct ifreq size in compat ioctl" Johannes Berg
2019-01-25 21:43 ` [PATCH net 2/4] Revert "kill dev_ifsioc()" Johannes Berg
2019-01-26 17:29   ` Al Viro
2019-01-26 17:45     ` Johannes Berg
2019-01-26 17:49       ` Johannes Berg
2019-01-26 18:53         ` Johannes Berg
2019-01-25 21:43 ` Johannes Berg [this message]
2019-01-25 21:43 ` [PATCH net 4/4] net: socket: make bond ioctls go through compat_ifreq_ioctl() Johannes Berg
2019-01-28 19:22 ` [PATCH net 0/4] various compat ioctl fixes David Miller
2019-01-28 21:32   ` Johannes Berg
2019-01-30  6:19     ` David Miller
2019-01-30 15:40     ` Al Viro
2019-01-30 18:20       ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190125214320.17685-4-johannes@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=johannes.berg@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=robert@ocallahan.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).