[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <57b62135-2159-493d-a6bb-47d5be55154a@app.fastmail.com>
Date: Fri, 26 Jan 2024 07:16:29 +0100
From: "Arnd Bergmann" <arnd@...db.de>
To: "Joe Damato" <jdamato@...tly.com>,
"Greg Kroah-Hartman" <gregkh@...uxfoundation.org>
Cc: linux-kernel@...r.kernel.org, Netdev <netdev@...r.kernel.org>,
"Chuck Lever" <chuck.lever@...cle.com>,
"Jeff Layton" <jlayton@...nel.org>, linux-api@...r.kernel.org,
"Christian Brauner" <brauner@...nel.org>,
"Eric Dumazet" <edumazet@...gle.com>,
"David S . Miller" <davem@...emloft.net>, alexander.duyck@...il.com,
"Sridhar Samudrala" <sridhar.samudrala@...el.com>,
"Jakub Kicinski" <kuba@...nel.org>,
"Willem de Bruijn" <willemdebruijn.kernel@...il.com>, weiwan@...gle.com,
"Jonathan Corbet" <corbet@....net>,
"Alexander Viro" <viro@...iv.linux.org.uk>, "Jan Kara" <jack@...e.cz>,
"Michael Ellerman" <mpe@...erman.id.au>,
"Nathan Lynch" <nathanl@...ux.ibm.com>,
"Steve French" <stfrench@...rosoft.com>,
"Thomas Zimmermann" <tzimmermann@...e.de>,
"Jiri Slaby" <jirislaby@...nel.org>,
"Julien Panis" <jpanis@...libre.com>,
"Andrew Waterman" <waterman@...s.berkeley.edu>,
"Thomas Huth" <thuth@...hat.com>, "Palmer Dabbelt" <palmer@...belt.com>,
"open list:DOCUMENTATION" <linux-doc@...r.kernel.org>,
"open list:FILESYSTEMS (VFS and infrastructure)"
<linux-fsdevel@...r.kernel.org>
Subject: Re: [PATCH net-next v3 3/3] eventpoll: Add epoll ioctl for epoll_params
On Fri, Jan 26, 2024, at 03:36, Joe Damato wrote:
> On Thu, Jan 25, 2024 at 04:23:58PM -0800, Greg Kroah-Hartman wrote:
>> On Thu, Jan 25, 2024 at 04:11:28PM -0800, Joe Damato wrote:
>> > On Thu, Jan 25, 2024 at 03:21:46PM -0800, Greg Kroah-Hartman wrote:
>> > > On Thu, Jan 25, 2024 at 10:56:59PM +0000, Joe Damato wrote:
>> > > > +struct epoll_params {
>> > > > + u64 busy_poll_usecs;
>> > > > + u16 busy_poll_budget;
>> > > > +
>> > > > + /* for future fields */
>> > > > + u8 data[118];
>> > > > +} EPOLL_PACKED;
>> > >
>
> Sure, that makes sense to me. I'll remove it in the v4 alongside the other
> changes you've requested.
>
> Thanks for your time and patience reviewing my code. I greatly appreciate
> your helpful comments and feedback.
Note that you should still pad the structure to its normal
alignment. On non-x86 targets this would currently mean a
multiple of 64 bits.
I would suggest dropping the EPOLL_PACKED here entirely and
just using a fully aligned structure on all architectures, like
struct epoll_params {
__aligned_u64 busy_poll_usecs;
__u16 busy_poll_budget;
__u8 __pad[6];
};
The explicit padding can help avoid leaking stack data when
a structure is copied back from kernel to userspace, so I would
just always use it in ioctl data structures.
Arnd
Powered by blists - more mailing lists