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  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:   Sat, 2 Oct 2021 10:22:23 +0800
From:   Rongwei Wang <>
To:     Hugh Dickins <>,
        Matthew Wilcox <>
Cc:     Song Liu <>,
        Andrew Morton <>,
        Linux MM <>,
        Linux Kernel Mailing List <>,
        William Kucharski <>
Subject: Re: [PATCH v2 1/2] mm, thp: check page mapping when truncating page

On 10/1/21 12:49 AM, Hugh Dickins wrote:
> On Thu, 30 Sep 2021, Matthew Wilcox wrote:
>> On Wed, Sep 29, 2021 at 10:24:44PM -0700, Hugh Dickins wrote:
>>> Aside from the above page->index mischeck in find_lock_entries(),
>>> I now think this bug needs nothing more than simply removing the
>>> VM_BUG_ON_PAGE(PageTail(page), page) from truncate_inode_page().
>> I don't think that's right.  This bug was also observed when calling
>> truncate(), so there's clearly a situation where two concurrent calls
>> to truncate_pagecache() leaves a THP in the cache.
> I assume you're thinking of one of the fuzzer blkdev ones:
> or
> I haven't started on those ones yet: yes, I imagine one or both of those
> will need a further fix (S_ISREG() check somewhere if we're lucky; but
> could well be nastier); but for the bug in this thread, I expect
> removing the VM_BUG_ON_PAGE(PageTail) to be enough.
Thanks for your advices!

I'm so sorry that delay the test due to my recent vacation. I plan to 
start further test tomorrow. I think removing the 
VM_BUG_ON_PAGE(PageTail) is a good idea, but also think using 
filemap_invalidate_lock is safer and necessary. And of course, this is 
just my own view! So, now, I tend to use filemap_invalidate_lock and
either check page mapping again or remove VM_BUG_ON_PAGE(PageTail).

Anyway, I will run more tests and then give feedback.

> If you're thinking of something else, please send a link if you can - thanks.
> Hugh

Powered by blists - more mailing lists