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]
Message-ID: <93c48e68-2266-72ee-0763-65805b94c968@suse.cz>
Date:   Mon, 24 Jan 2022 11:30:10 +0100
From:   Vlastimil Babka <vbabka@...e.cz>
To:     Wei Yang <richard.weiyang@...il.com>
Cc:     Matthew Wilcox <willy@...radead.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        peterz@...radead.org, will@...nel.org, linyunsheng@...wei.com,
        aarcange@...hat.com, feng.tang@...el.com, ebiederm@...ssion.com,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm: remove offset check on page->compound_head and
 folio->lru

On 1/23/22 02:38, Wei Yang wrote:
> On Sat, Jan 08, 2022 at 08:13:40AM +0000, Wei Yang wrote:
>>On Sat, Jan 08, 2022 at 12:49:53AM +0000, Matthew Wilcox wrote:
>>>On Fri, Jan 07, 2022 at 04:08:25PM -0800, Andrew Morton wrote:
>>>> On Fri, 7 Jan 2022 22:11:20 +0000 Matthew Wilcox <willy@...radead.org> wrote:
>>>> 
>>>> > > Hi, Matthew
>>>> > > 
>>>> > > Would you mind sharing some insight on this check?
>>>> > 
>>>> > It's right there in the comments.
>>>> 
>>>> Well I can't figure out which comment you're referring to?
>>>
>>>         * WARNING: bit 0 of the first word is used for PageTail(). That
>>>         * means the other users of this union MUST NOT use the bit to
>>>         * avoid collision and false-positive PageTail().
>>>
>>
>>I know this requirement on bit 0 of first word. But I don't see the connection
>>between this and the check of page->compound_head and folio->lru.
>>
>>This is more like a internal requirement on struct page. There are 8 struct in
>>this five words union. And this requirement apply to bit 0 of first word of
>>all those five struct.
>>
>>To me, if folio has the same layout of page, folio meets this requirement. I
>>still not catch the point why we need this check here.
>>
> 
> Hi, Matthew
> 
> Are you back from vocation? If you could give more insight on this check, I
> would be appreciated.

I can offer my insight (which might be of course wrong). Ideally one day
page.lru will be gone and only folio will be used for LRU pages. Then there
won't be a  FOLIO_MATCH(lru, lru); and FOLIO_MATCH(compound_head, lru);
won't appear to be redundant anymore. lru is list_head so two pointers and
thus valid pointers are aligned in such a way they can't accidentaly set the
bit 0.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ