All of lore.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: netdev@vger.kernel.org
Cc: Ralf Baechle <ralf@linux-mips.org>
Subject: [RFC] compat SIOCADDRT problems
Date: Sun, 1 Oct 2017 23:13:12 +0100	[thread overview]
Message-ID: <20171001221312.GG21978@ZenIV.linux.org.uk> (raw)

	Handling of SIOC{ADD,DEL}RT for 32bit is somewhat odd.  AFAICS,
the rules for native ioctl look so:

AF_APPLETALK, AF_INET, AF_IPX, AF_PACKET: take struct rtentry.  The last one
doesn't have ->compat_ioctl() and 32bit automatically hits routing_ioctl()
in net/socket.c, the rest have ->compat_ioctl() but it doesn't recognize
SIOC{ADD,DEL}RT, so it ends up handled by the same code.

AF_INET6: takes struct in6_rtmsg.  Hits routing_ioctl(), which recognizes ipv6
and does the right thing.

AF_X25: takes x25_route_struct.  Layout is apparently identical for 32bit and
64bit.  Has ->compat_ioctl(), which does the same thing as ->ioctl() on those
two.

AF_AX25: takes struct ax25_routes_struct.  Again, identical layout on 32bit
and 64bit.  Unfortunately, there's no ->compat_ioctl() in this one, so we
end up hitting routing_ioctl() and get screwed.
AF_NETROM: same as previous, except that it takes struct nr_route_struct.
Apparently broken.
AF_ROSE: ditto, with struct rose_route_struct.

AF_QIPCRTR: explicitly recognizes and fails with -EINVAL.  Odd (other protocol
families without SIOCADDRT support fail with -ENOTTY), but clearly not an issue
for compat code.

Everything else: fails with -ENOTTY.


	Are AF_{AX25,NETROM,ROSE} really broken for 32bit processes on biarch
hosts, or am I missing something subtle in there?

                 reply	other threads:[~2017-10-01 22:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20171001221312.GG21978@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=ralf@linux-mips.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.