linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org, y2038@lists.linaro.org,
	linux-kernel@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
	Marcel Holtmann <marcel@holtmann.org>,
	Johan Hedberg <johan.hedberg@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Stefan Schmidt <stefan@datenfreihafen.org>,
	Matthias Kaehlcke <mka@chromium.org>,
	Kees Cook <keescook@chromium.org>,
	Yangtao Li <tiny.windzz@gmail.com>,
	linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org
Subject: [PATCH v3 16/26] compat_ioctl: move rfcomm handlers into driver
Date: Tue, 16 Apr 2019 22:25:37 +0200	[thread overview]
Message-ID: <20190416202701.127745-5-arnd@arndb.de> (raw)
In-Reply-To: <20190416202701.127745-1-arnd@arndb.de>

All these ioctl commands are compatible, so we can handle
them with a trivial wrapper in rfcomm/sock.c and remove
the listing in fs/compat_ioctl.c.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 fs/compat_ioctl.c           |  6 ------
 net/bluetooth/rfcomm/sock.c | 14 ++++++++++++--
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
index aad7071eaee0..efe3df389150 100644
--- a/fs/compat_ioctl.c
+++ b/fs/compat_ioctl.c
@@ -42,7 +42,6 @@
 
 #include <net/bluetooth/bluetooth.h>
 #include <net/bluetooth/hci_sock.h>
-#include <net/bluetooth/rfcomm.h>
 
 #ifdef CONFIG_BLOCK
 #include <linux/cdrom.h>
@@ -614,11 +613,6 @@ COMPATIBLE_IOCTL(HCIUARTGETPROTO)
 COMPATIBLE_IOCTL(HCIUARTGETDEVICE)
 COMPATIBLE_IOCTL(HCIUARTSETFLAGS)
 COMPATIBLE_IOCTL(HCIUARTGETFLAGS)
-COMPATIBLE_IOCTL(RFCOMMCREATEDEV)
-COMPATIBLE_IOCTL(RFCOMMRELEASEDEV)
-COMPATIBLE_IOCTL(RFCOMMGETDEVLIST)
-COMPATIBLE_IOCTL(RFCOMMGETDEVINFO)
-COMPATIBLE_IOCTL(RFCOMMSTEALDLC)
 /* Misc. */
 COMPATIBLE_IOCTL(PCIIOC_CONTROLLER)
 COMPATIBLE_IOCTL(PCIIOC_MMAP_IS_IO)
diff --git a/net/bluetooth/rfcomm/sock.c b/net/bluetooth/rfcomm/sock.c
index 90bb53aa4bee..b4eaf21360ef 100644
--- a/net/bluetooth/rfcomm/sock.c
+++ b/net/bluetooth/rfcomm/sock.c
@@ -24,7 +24,7 @@
 /*
  * RFCOMM sockets.
  */
-
+#include <linux/compat.h>
 #include <linux/export.h>
 #include <linux/debugfs.h>
 #include <linux/sched/signal.h>
@@ -909,6 +909,13 @@ static int rfcomm_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned lon
 	return err;
 }
 
+#ifdef CONFIG_COMPAT
+static int rfcomm_sock_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
+{
+	return rfcomm_sock_ioctl(sock, cmd, (unsigned long)compat_ptr(arg));
+}
+#endif
+
 static int rfcomm_sock_shutdown(struct socket *sock, int how)
 {
 	struct sock *sk = sock->sk;
@@ -1042,7 +1049,10 @@ static const struct proto_ops rfcomm_sock_ops = {
 	.gettstamp	= sock_gettstamp,
 	.poll		= bt_sock_poll,
 	.socketpair	= sock_no_socketpair,
-	.mmap		= sock_no_mmap
+	.mmap		= sock_no_mmap,
+#ifdef CONFIG_COMPAT
+	.compat_ioctl	= rfcomm_sock_compat_ioctl,
+#endif
 };
 
 static const struct net_proto_family rfcomm_sock_family_ops = {
-- 
2.20.0


  parent reply	other threads:[~2019-04-16 20:29 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-16 20:19 [PATCH v3 00/26] compat_ioctl: cleanups Arnd Bergmann
2019-04-16 20:19 ` [PATCH v3 01/26] compat_ioctl: pppoe: fix PPPOEIOCSFWD handling Arnd Bergmann
2019-04-16 20:19 ` [PATCH v3 02/26] compat_ioctl: move simple ppp command handling into driver Arnd Bergmann
2019-04-17 21:13   ` Al Viro
2019-04-17 22:03     ` Arnd Bergmann
2019-04-17 23:53       ` Al Viro
2019-04-18  5:57         ` Al Viro
2019-04-18 15:14         ` Arnd Bergmann
2019-04-16 20:19 ` [PATCH v3 03/26] compat_ioctl: avoid unused function warning for do_ioctl Arnd Bergmann
2019-04-16 20:19 ` [PATCH v3 04/26] compat_ioctl: move PPPIOCSCOMPRESS32 to ppp-generic.c Arnd Bergmann
2019-04-17 21:16   ` Al Viro
2019-04-17 21:44     ` Arnd Bergmann
2019-04-16 20:19 ` [PATCH v3 05/26] compat_ioctl: move PPPIOCSPASS32/PPPIOCSACTIVE32 to ppp_generic.c Arnd Bergmann
2019-04-16 20:19 ` [PATCH v3 06/26] compat_ioctl: handle PPPIOCGIDLE for 64-bit time_t Arnd Bergmann
2019-04-16 20:19 ` [PATCH v3 07/26] compat_ioctl: move rtc handling into rtc-dev.c Arnd Bergmann
2019-04-16 20:19 ` [PATCH v3 08/26] compat_ioctl: add compat_ptr_ioctl() Arnd Bergmann
2019-04-17 21:19   ` Al Viro
2019-04-17 21:34     ` Arnd Bergmann
2019-04-16 20:19 ` [PATCH v3 09/26] compat_ioctl: move drivers to compat_ptr_ioctl Arnd Bergmann
2019-04-16 20:31   ` Jiri Kosina
2019-04-18 11:10   ` Stefan Hajnoczi
2019-04-19 23:16   ` Michael S. Tsirkin
2019-04-16 20:19 ` [PATCH v3 10/26] compat_ioctl: use correct compat_ptr() translation in drivers Arnd Bergmann
2019-04-17 21:21   ` Al Viro
2019-04-16 20:19 ` [PATCH v3 11/26] ceph: fix compat_ioctl for ceph_dir_operations Arnd Bergmann
2019-04-17 21:23   ` Al Viro
2019-04-17 21:31     ` Arnd Bergmann
2019-04-16 20:25 ` [PATCH v3 12/26] compat_ioctl: move more drivers to compat_ptr_ioctl Arnd Bergmann
2019-04-16 20:25   ` [PATCH v3 13/26] compat_ioctl: move tape handling into drivers Arnd Bergmann
2019-04-16 20:25   ` [PATCH v3 14/26] compat_ioctl: move ATYFB_CLK handling to atyfb driver Arnd Bergmann
2019-04-17 21:27     ` Al Viro
2019-04-17 21:28       ` Al Viro
2019-05-06 13:37     ` Bartlomiej Zolnierkiewicz
2019-04-16 20:25   ` [PATCH v3 15/26] compat_ioctl: move isdn/capi ioctl translation into driver Arnd Bergmann
2019-04-16 20:25   ` Arnd Bergmann [this message]
2019-04-16 20:25   ` [PATCH v3 17/26] compat_ioctl: move hci_sock handlers " Arnd Bergmann
2019-04-16 20:25   ` [PATCH v3 18/26] compat_ioctl: remove HCIUART handling Arnd Bergmann
2019-04-16 20:25   ` [PATCH v3 19/26] compat_ioctl: remove HIDIO translation Arnd Bergmann
2019-04-25 15:21   ` [PATCH v3 12/26] compat_ioctl: move more drivers to compat_ptr_ioctl Mauro Carvalho Chehab
2019-04-25 15:32     ` Arnd Bergmann
2019-04-25 15:35     ` Al Viro
2019-04-25 15:53       ` Mauro Carvalho Chehab
2019-04-25 15:55       ` Arnd Bergmann
2019-04-25 16:42         ` Al Viro
2019-04-25 21:25         ` Johannes Berg
2019-04-26  7:46           ` Arnd Bergmann
2019-04-16 20:28 ` [PATCH v3 20/26] compat_ioctl: remove translation for sound ioctls Arnd Bergmann
2019-04-16 20:28   ` [PATCH v3 21/26] compat_ioctl: remove IGNORE_IOCTL() Arnd Bergmann
2019-04-16 20:28   ` [PATCH v3 22/26] compat_ioctl: remove /dev/random commands Arnd Bergmann
2019-04-16 20:28   ` [PATCH v3 23/26] compat_ioctl: remove joystick ioctl translation Arnd Bergmann
2019-04-16 20:28   ` [PATCH v3 24/26] compat_ioctl: remove PCI " Arnd Bergmann
2019-04-16 20:28   ` [PATCH v3 25/26] compat_ioctl: remove /dev/raw " Arnd Bergmann
2019-04-16 20:28   ` [PATCH v3 26/26] compat_ioctl: remove last RAID handling code Arnd Bergmann
2019-04-17  8:05   ` [PATCH v3 20/26] compat_ioctl: remove translation for sound ioctls Takashi Iwai
2019-04-29  7:05     ` Takashi Iwai
2019-04-29 12:43       ` Arnd Bergmann
2019-04-16 22:33 ` [PATCH v3 00/26] compat_ioctl: cleanups Douglas Gilbert

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=20190416202701.127745-5-arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=johan.hedberg@gmail.com \
    --cc=keescook@chromium.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=mka@chromium.org \
    --cc=netdev@vger.kernel.org \
    --cc=stefan@datenfreihafen.org \
    --cc=tiny.windzz@gmail.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=y2038@lists.linaro.org \
    /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).