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]
Date:   Wed, 11 Nov 2020 23:00:06 +0000
From:   Al Viro <viro@...iv.linux.org.uk>
To:     Linus Torvalds <torvalds@...ux-foundation.org>
Cc:     Christoph Hellwig <hch@....de>,
        Greg KH <gregkh@...uxfoundation.org>,
        Alexey Dobriyan <adobriyan@...il.com>,
        linux-fsdevel <linux-fsdevel@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/6] seq_file: add seq_read_iter

On Wed, Nov 11, 2020 at 02:27:02PM -0800, Linus Torvalds wrote:
> On Wed, Nov 11, 2020 at 2:21 PM Al Viro <viro@...iv.linux.org.uk> wrote:
> >
> > Something like below (build-tested only):
> 
> Apart from my usual "oh, Gods, the iter model really does confuse me"
> this looks more like what I expected, yes.
> 
> Considering the original bug, I'm clearly not the only one confused by
> the iov_iter helper functions and the rules..

copy_to_iter() returns the amount it has actually copied, that's all;
the cause of that bug is not the primitives used, it's the rules for
->read_iter().  The rules are actually fairly simple - "->read_iter()
should not report less data than it has actually left there".  For read(2)
it's a matter of QoI - if we hit an unmapped page, POSIX pretty much says
that all bets are off; read(fd, unmapped - 5, 8) might copy 5 bytes and
return 4.  It is allowed (and read(2) on those files used to do just that),
but it's nicer not to do so.  For generic_file_splice_read(), OTOH, it's
a bug - we end up with stray data spewed into pipe.  So converting
to ->read_iter() needs some care.  Probably something along those
lines should go into D/f/porting...

Powered by blists - more mailing lists