af_unix: add compat_ioctl support
authorArnd Bergmann <arnd@arndb.de>
Mon, 3 Jun 2019 20:03:44 +0000 (22:03 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Jan 2020 18:48:52 +0000 (19:48 +0100)
commit60cc5607bdc0dbbaf3482f540978094f0a127f7e
tree60e30394c74ddb78656dedd6ce8d372d4a51729f
parentde1605c603e6b5e350f0f575e8f038a1e6b65e92
af_unix: add compat_ioctl support

commit 5f6beb9e0f633f3cc845cdd67973c506372931b4 upstream.

The af_unix protocol family has a custom ioctl command (inexplicibly
based on SIOCPROTOPRIVATE), but never had a compat_ioctl handler for
32-bit applications.

Since all commands are compatible here, add a trivial wrapper that
performs the compat_ptr() conversion for SIOCOUTQ/SIOCINQ.  SIOCUNIXFILE
does not use the argument, but it doesn't hurt to also use compat_ptr()
here.

Fixes: ba94f3088b79 ("unix: add ioctl to open a unix socket file with O_PATH")
Cc: netdev@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/unix/af_unix.c