[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAK8P3a2txp1_D8Mn3yHzreKBD0E2fnfrDgN9OOU+-stpzyUDLg@mail.gmail.com>
Date: Thu, 1 Oct 2020 17:00:03 +0200
From: Arnd Bergmann <arnd@...db.de>
To: Christoph Hellwig <hch@...radead.org>
Cc: "David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Jiri Pirko <jiri@...lanox.com>,
Taehee Yoo <ap420073@...il.com>,
Eric Dumazet <edumazet@...gle.com>,
Alexei Starovoitov <ast@...nel.org>,
Andrew Lunn <andrew@...n.ch>, Jens Axboe <axboe@...nel.dk>,
Networking <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] dev_ioctl: split out SIOC?IFMAP ioctls
On Tue, Sep 29, 2020 at 7:53 PM Christoph Hellwig <hch@...radead.org> wrote:
> On Fri, Sep 25, 2020 at 02:28:29PM +0200, Arnd Bergmann wrote:
> > Do you mean we should check that the (larger) user space size
> > remains what it is for future changes, or that the (smaller)
> > kernel size remains the same on all kernels, or maybe both?
>
> I had something like:
>
> BUILD_BUG_ON(sizeof(struct ifmap) >
> sizeof(struct ifreq) - IFNAMSIZ);
>
> plus a suitable comment in mind.
But that condition is true on all 64-bit architectures, which is the
fundamental issue I'm working around. I can try to capture that
better in the comment though.
My expectation here is that passing the smaller 'ifreq' structure
to ndo_do_ioctl() is safe as long as all drivers use only the
remaining members of ifr_ifru that all fit into the first 16 bytes.
Do you see a problem with that assumption?
Arnd
Powered by blists - more mailing lists