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:   Tue, 4 Aug 2020 08:59:32 +0530
From:   Anup Patel <anup@...infault.org>
To:     Greentime Hu <greentime.hu@...ive.com>
Cc:     linux-riscv <linux-riscv@...ts.infradead.org>,
        "linux-kernel@...r.kernel.org List" <linux-kernel@...r.kernel.org>,
        Albert Ou <aou@...s.berkeley.edu>,
        Palmer Dabbelt <palmer@...belt.com>,
        Paul Walmsley <paul.walmsley@...ive.com>, syven.wang@...ive.com
Subject: Re: [PATCH] riscv: Add sfence.vma after page table changed

On Tue, Aug 4, 2020 at 8:32 AM Greentime Hu <greentime.hu@...ive.com> wrote:
>
> This patch addes local_flush_tlb_page(addr) to use sfence.vma after the

s/addes/adds

> page table changed. That address will be used immediately in
> memset(nextp, 0, PAGE_SIZE) to cause this issue so we should add the
> sfence.vma before we use it.

Alternate version of this commit description can be:

Invalidate local TLB after both set_pet() and clear_pte() because the
address can be used immediately after page table change.

>
> Fixes: f2c17aabc917 ("RISC-V: Implement compile-time fixed mappings")
>
> Reported-by: Syven Wang <syven.wang@...ive.com>
> Signed-off-by: Syven Wang <syven.wang@...ive.com>
> Signed-off-by: Greentime Hu <greentime.hu@...ive.com>
> ---
>  arch/riscv/mm/init.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
> index f4adb3684f3d..29b0f7108054 100644
> --- a/arch/riscv/mm/init.c
> +++ b/arch/riscv/mm/init.c
> @@ -202,12 +202,11 @@ void __set_fixmap(enum fixed_addresses idx, phys_addr_t phys, pgprot_t prot)
>
>         ptep = &fixmap_pte[pte_index(addr)];
>
> -       if (pgprot_val(prot)) {
> +       if (pgprot_val(prot))
>                 set_pte(ptep, pfn_pte(phys >> PAGE_SHIFT, prot));
> -       } else {
> +       else
>                 pte_clear(&init_mm, addr, ptep);
> -               local_flush_tlb_page(addr);
> -       }
> +       local_flush_tlb_page(addr);
>  }
>
>  static pte_t *__init get_pte_virt(phys_addr_t pa)
> --
> 2.28.0
>

Otherwise looks good to me.

Reviewed-by: Anup Patel <anup@...infault.org>

Regards,
Anup

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ