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: <42f1209a686404ffd0f9dff05ed10a8d23383a11.camel@mediatek.com>
Date:   Wed, 26 Jul 2023 06:59:20 +0000
From:   Andrew Yang (楊智強) 
        <Andrew.Yang@...iatek.com>
To:     "senozhatsky@...omium.org" <senozhatsky@...omium.org>
CC:     "bigeasy@...utronix.de" <bigeasy@...utronix.de>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-mediatek@...ts.infradead.org" 
        <linux-mediatek@...ts.infradead.org>,
        "linux-mm@...ck.org" <linux-mm@...ck.org>,
        wsd_upstream <wsd_upstream@...iatek.com>,
        Casper Li (李中榮) <casper.li@...iatek.com>,
        "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
        "minchan@...nel.org" <minchan@...nel.org>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "matthias.bgg@...il.com" <matthias.bgg@...il.com>,
        "angelogioacchino.delregno@...labora.com" 
        <angelogioacchino.delregno@...labora.com>
Subject: Re: [PATCH] zsmalloc: Fix races between modifications of fullness and
 isolated

On Wed, 2023-07-26 at 12:18 +0900, Sergey Senozhatsky wrote:
>  	 
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
>  On (23/07/21 14:37), Andrew Yang wrote:
> > 
> > Since fullness and isolated share the same unsigned int,
> > modifications of them should be protected by the same lock.
> > 
> > Signed-off-by: Andrew Yang <andrew.yang@...iatek.com>
> > Fixes: c4549b871102 ("zsmalloc: remove zspage isolation for
> migration")
> 
> Have you observed issues in real life? That commit is more than a
> year
> and a half old, so I wonder.
> 
Yes, we encountered many kernel exceptions of
VM_BUG_ON(zspage->isolated == 0) in dec_zspage_isolation() and
BUG_ON(!pages[1]) in zs_unmap_object() lately.
This issue only occurs when migration and reclamation occur at the
same time. With our memory stress test, we can reproduce this issue
several times a day. We have no idea why no one else encountered
this issue. BTW, we switched to the new kernel version with this
defect a few months ago.
> > @@ -1858,8 +1860,8 @@ static int zs_page_migrate(struct page
> *newpage, struct page *page,
> >   * Since we complete the data copy and set up new zspage
> structure,
> >   * it's okay to release the pool's lock.
> >   */
> 
> This comment should be moved too, because this is not where we unlock
> the
> pool anymore.
> 
Okay, I will submit a new patch later.
> > -spin_unlock(&pool->lock);
> >  dec_zspage_isolation(zspage);
> > +spin_unlock(&pool->lock);
> >  migrate_write_unlock(zspage);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ