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: <305b4dec-c99d-3cee-4563-8d7dcbae9384@ghiti.fr>
Date:   Tue, 3 Oct 2023 17:43:10 +0200
From:   Alexandre Ghiti <alex@...ti.fr>
To:     Alexandre Ghiti <alexghiti@...osinc.com>,
        Paul Walmsley <paul.walmsley@...ive.com>,
        Palmer Dabbelt <palmer@...belt.com>,
        Albert Ou <aou@...s.berkeley.edu>,
        Andrew Jones <ajones@...tanamicro.com>,
        Qinglin Pan <panqinglin2020@...as.ac.cn>,
        Ryan Roberts <ryan.roberts@....com>,
        linux-riscv@...ts.infradead.org, linux-kernel@...r.kernel.org,
        "linux-mm@...ck.org" <linux-mm@...ck.org>,
        Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH -fixes 0/2] Fix set_huge_pte_at()

+cc Andrew: Would  you mind taking this patchset in your tree for the 
next rc? This patchset depends on a previous fix for arm64 that you 
merged in rc4 which is not in the riscv -fixes branch yet.

I saw with Palmer and he should ack this shortly.

If I can do anything else to help, let me know.

Thanks,

Alex

On 28/09/2023 17:18, Alexandre Ghiti wrote:
> A recent report [1] from Ryan for arm64 revealed that we do not handle
> swap entries when setting a hugepage backed by a NAPOT region (the
> contpte riscv equivalent).
>
> As explained in [1], the issue was discovered by a new test in kselftest
> which uses poison entries, but the symptoms are different from arm64 though:
>
> - the riscv kernel bugs because we do not handle VM_FAULT_HWPOISON*,
>    this is fixed by patch 1,
> - after that, the test passes because the first pte_napot() fails (the
>    poison entry does not have the N bit set), and then we only set the
>    first page table entry covering the NAPOT hugepage, which is enough
>    for hugetlb_fault() to correctly raise a VM_FAULT_HWPOISON wherever we
>    write in this mapping since only this first page table entry is
>    checked
>    (see https://elixir.bootlin.com/linux/v6.6-rc3/source/mm/hugetlb.c#L6071).
>    But this seems fragile so patch 2 sets all page table entries of a
>    NAPOT mapping.
>
> [1]: https://lore.kernel.org/linux-arm-kernel/20230922115804.2043771-1-ryan.roberts@arm.com/
>
>
> Alexandre Ghiti (2):
>    riscv: Handle VM_FAULT_[HWPOISON|HWPOISON_LARGE] faults instead of
>      panicking
>    riscv: Fix set_huge_pte_at() for NAPOT mappings when a swap entry is
>      set
>
>   arch/riscv/mm/fault.c       |  2 +-
>   arch/riscv/mm/hugetlbpage.c | 19 +++++++++++++------
>   2 files changed, 14 insertions(+), 7 deletions(-)
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ