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]
Message-ID: <bcefb739-b45c-8349-8010-ac137ab61c29@suse.cz>
Date:   Wed, 6 Sep 2023 10:00:56 +0200
From:   Vlastimil Babka <vbabka@...e.cz>
To:     Sean Christopherson <seanjc@...gle.com>
Cc:     ackerleytng@...gle.com, akpm@...ux-foundation.org,
        anup@...infault.org, aou@...s.berkeley.edu,
        chao.p.peng@...ux.intel.com, chenhuacai@...nel.org,
        david@...hat.com, isaku.yamahata@...il.com, jarkko@...nel.org,
        jmorris@...ei.org, kirill.shutemov@...ux.intel.com,
        kvm-riscv@...ts.infradead.org, kvm@...r.kernel.org,
        kvmarm@...ts.linux.dev, liam.merwick@...cle.com,
        linux-arm-kernel@...ts.infradead.org,
        linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-mips@...r.kernel.org, linux-mm@...ck.org,
        linux-riscv@...ts.infradead.org,
        linux-security-module@...r.kernel.org,
        linuxppc-dev@...ts.ozlabs.org, mail@...iej.szmigiero.name,
        maz@...nel.org, michael.roth@....com, mpe@...erman.id.au,
        oliver.upton@...ux.dev, palmer@...belt.com,
        paul.walmsley@...ive.com, paul@...l-moore.com, pbonzini@...hat.com,
        qperret@...gle.com, serge@...lyn.com, tabba@...gle.com,
        vannapurve@...gle.com, wei.w.wang@...el.com, willy@...radead.org,
        yu.c.zhang@...ux.intel.com
Subject: Re: [PATCH gmem FIXUP] mm, compaction: make testing
 mapping_unmovable() safe

On 9/6/23 01:56, Sean Christopherson wrote:
> On Fri, Sep 01, 2023, Vlastimil Babka wrote:
>> As Kirill pointed out, mapping can be removed under us due to
>> truncation. Test it under folio lock as already done for the async
>> compaction / dirty folio case. To prevent locking every folio with
>> mapping to do the test, do it only for unevictable folios, as we can
>> expect the unmovable mapping folios are also unevictable - it is the
>> case for guest memfd folios.
> 
> Rather than expect/assume that unmovable mappings are always unevictable, how about
> requiring that?  E.g. either through a VM_WARN_ON in mapping_set_unmovable(), or by
> simply having that helper forcefully set AS_UNEVICTABLE as well.

Yeah I guess we could make the helper do that, with a comment, as gmem is
the only user right now. And if in the future somebody has case where it
makes sense to have unmovable without unevictable, we can discuss what to do
about it then.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ