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-next>] [day] [month] [year] [list]
Message-ID: <2752208.1642413437@warthog.procyon.org.uk>
Date:   Mon, 17 Jan 2022 09:57:17 +0000
From:   David Howells <dhowells@...hat.com>
To:     Alexander Viro <viro@...iv.linux.org.uk>,
        Linus Torvalds <torvalds@...ux-foundation.org>
cc:     dhowells@...hat.com, Anna Schumaker <anna.schumaker@...app.com>,
        Dave Wysochanski <dwysocha@...hat.com>,
        Dominique Martinet <asmadeus@...ewreck.org>,
        Jeff Layton <jlayton@...nel.org>,
        Latchesar Ionkov <lucho@...kov.net>,
        Marc Dionne <marc.dionne@...istor.com>,
        Matthew Wilcox <willy@...radead.org>,
        Omar Sandoval <osandov@...ndov.com>,
        Shyam Prasad N <nspmangalore@...il.com>,
        Steve French <sfrench@...ba.org>,
        Trond Myklebust <trondmy@...merspace.com>,
        Peter Zijlstra <peterz@...radead.org>,
        ceph-devel@...r.kernel.org, linux-afs@...ts.infradead.org,
        linux-cachefs@...hat.com, linux-cifs@...r.kernel.org,
        linux-fsdevel@...r.kernel.org, linux-mm@...ck.org,
        linux-nfs@...r.kernel.org, v9fs-developer@...ts.sourceforge.net,
        linux-kernel@...r.kernel.org
Subject: Out of order read() completion and buffer filling beyond returned amount

Hi Al, Linus,

Do you have an opinion on whether it's permissible for a filesystem to write
into the read() buffer beyond the amount it claims to return, though still
within the specified size of the buffer?

I'm working on common DIO routines for 9p, afs, ceph and cifs in netfs lib,
and I can see that at least three of those four filesystems either can or must
split a read, possibly being required to distribute across multiple servers.

If a filesystem was to emit multiple read RPCs in parallel, there is the
possibility that they would complete out of order - particularly if they go to
multiple servers.

Would it be a violation of the way the read() family of syscalls work to write
the data into the buffers out of order, and then abandon the extra data
written at the end if one of the RPCs returned a short read?  We would have
clobbered some of the buffer that we haven't said we've modified.

For buffered reads, it's not a problem as we can fill the pagecache out of
order with no issue.

David

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ