[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20240209-milchglas-aufzuarbeiten-f34f1491be02@brauner>
Date: Fri, 9 Feb 2024 11:18:37 +0100
From: Christian Brauner <brauner@...nel.org>
To: Eric Biggers <ebiggers@...nel.org>
Cc: wenyang.linux@...mail.com, Jens Axboe <axboe@...nel.dk>,
Alexander Viro <viro@...iv.linux.org.uk>, Jan Kara <jack@...e.cz>, David Woodhouse <dwmw@...zon.co.uk>,
Matthew Wilcox <willy@...radead.org>, linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] eventfd: strictly check the count parameter of
eventfd_write to avoid inputting illegal strings
On Wed, Feb 07, 2024 at 08:33:54PM -0800, Eric Biggers wrote:
> On Wed, Feb 07, 2024 at 12:35:18AM +0800, wenyang.linux@...mail.com wrote:
> > By checking whether count is equal to sizeof(ucnt), such errors
> > could be detected. It also follows the requirements of the manual.
>
> Does it? This is what the eventfd manual page says:
>
> A write(2) fails with the error EINVAL if the size of the supplied buffer
> is less than 8 bytes, or if an attempt is made to write the value
> 0xffffffffffffffff.
>
> So, *technically* it doesn't mention the behavior if the size is greater than 8
> bytes. But one might assume that such writes are accepted, since otherwise it
> would have been mentioned that they're rejected, just like writes < 8 bytes.
>
> If the validation is indeed going to be made more strict, the manual page will
> need to be fixed alongside it.
Do you prefer we drop this patch?
Powered by blists - more mailing lists