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:   Fri, 14 Jan 2022 13:00:27 +0800
From:   "zhangliang (AG)" <zhangliang5@...wei.com>
To:     David Hildenbrand <david@...hat.com>
CC:     Andrew Morton <akpm@...ux-foundation.org>,
        Linux-MM <linux-mm@...ck.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        <wangzhigang17@...wei.com>, Matthew Wilcox <willy@...radead.org>,
        "Linus Torvalds" <torvalds@...ux-foundation.org>
Subject: Re: [PATCH] mm: reuse the unshared swapcache page in do_wp_page



On 2022/1/14 0:48, David Hildenbrand wrote:
> On 13.01.22 17:37, Linus Torvalds wrote:
>> On Thu, Jan 13, 2022 at 6:39 AM Matthew Wilcox <willy@...radead.org> wrote:
>>>
>>> Let's bring Linus in on this, but I think this reintroduces all of the
>>> mapcount problems that we've been discussing recently.
>>>
>>> How about this as an alternative?
>>
>> No, at that point reuse_swap_page() is the better thing to do.
>>
>> Don't play games with page_count() (or even worse games with
>> swap_count). The page count is only stable if it's 1. Any other value
>> means that it can fluctuate due to concurrent lookups, some of which
>> can be done locklessly under RCU.
> 
> I'm pretty sure the patch as is will reintroduce the CVE. So I think in

Actually, I wonder how reuse_swap_page() in this patch can reintroduce CVE,
I think the invoking logic here is as same as that in do_swap_page(). 
So, could you give me some hint about this? Thanks :)

> addition to the reuse_swap_page() check we need more.
> 
> I'm wondering if we can get rid of the mapcount checks in
> reuse_swap_page() and instead check for page_count() and swapcount only.
> 
> We don't care if it's unstable in a sense than it will be bigger than
> what we expect. In that case we COW as we would already do.
> 
> Thoughts?
> 

-- 
Best Regards,
Liang Zhang

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ