lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YrcXmwjPeJ77xsY2@ZenIV>
Date:   Sat, 25 Jun 2022 15:11:39 +0100
From:   Al Viro <viro@...iv.linux.org.uk>
To:     Christoph Hellwig <hch@...radead.org>
Cc:     "Jason A. Donenfeld" <Jason@...c4.com>,
        linux-kernel@...r.kernel.org, Jens Axboe <axboe@...nel.dk>,
        linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH v2 3/8] fs: clear or set FMODE_LSEEK based on llseek
 function

On Sat, Jun 25, 2022 at 06:39:52AM -0700, Christoph Hellwig wrote:
> On Sat, Jun 25, 2022 at 02:29:09PM +0100, Al Viro wrote:
> > I wouldn't bet on that - as it is, an ->open() instance can decide
> > in some cases to clear FMODE_LSEEK, despite having file_operations
> > with non-NULL ->llseek.
> 
> The interesting cases here are nonseekable_open and stream_open,
> and I don't see why we could not fix this up in the file_operations.

What's the point, really?  We can easily enforce "no FMODE_LSEEK ever
observed on files with NULL ->llseek" (this series does that), so we
can use that check alone in e.g. vfs_llseek() or dump_skip().

Sure, we are tight on bits in ->f_mode, but there's a better way to
relieve that problem - split the field into "stuff that needs to
be preserved all the way until __fput()" and the rest; the latter
could sit next to ->f_iocb_flags, with no increase of struct file
size.

So if you are worried about FMODE_... space getting exhausted, that's
better dealt with in a different way, IMO.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ