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] [day] [month] [year] [list]
Date:   Mon, 2 Jul 2018 17:05:18 +0200
From:   Andreas Gruenbacher <agruenba@...hat.com>
To:     Christoph Hellwig <hch@....de>
Cc:     cluster-devel <cluster-devel@...hat.com>,
        linux-ext4 <linux-ext4@...r.kernel.org>,
        linux-fsdevel <linux-fsdevel@...r.kernel.org>
Subject: Re: [PATCH] iomap: Add inline data support to iomap_readpage_actor

On 2 July 2018 at 14:52, Christoph Hellwig <hch@....de> wrote:
> On Sun, Jul 01, 2018 at 11:43:43PM +0200, Andreas Gruenbacher wrote:
>> > +               WARN_ON_ONCE(plen != PAGE_SIZE);
>>
>> Inline mappings only extend to the end of the file (iomap->offset == 0
>> && iomap->length == inode->i_size), so length and plen will be
>> inode->i_size here. This assertion should just be removed.
>
> But we should generally still return PAGE_SIZE from iomap_begin
> because we cover the whole page and zero the rest, don't we?

iomap_begin doesn't know when it's being called for readpage. Direct
I/O reads don't pad to the page size,  for example, so handling the
padding in the caller seems reasonable. If you compare with regular
block-based mappings, those are also block but not necessarily page
aligned.

For stuffed files, iomap_begin will return an IOMAP_HOLE mapping for
offsets beyond the end of the file, so iterating beyond the end of the
file is fine (even if readpage doesn't do that).

> Either way, I can remove the assert from now.

Yes, thanks.

Andreas

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ