Thread (10 messages) 10 messages, 5 authors, 2021-11-16

Re: [PATCHv2] arm64: mm: Fix VM_BUG_ON(mm != &init_mm) for trans_pgd

From: Catalin Marinas <catalin.marinas@arm.com>
Date: 2021-11-12 14:27:26

On Fri, Nov 12, 2021 at 01:22:14PM +0800, Pingfan Liu wrote:
trans_pgd_create_copy() can hit "VM_BUG_ON(mm != &init_mm)" in the
function pmd_populate_kernel().

This is the combined consequence of commit 5de59884ac0e ("arm64:
trans_pgd: pass NULL instead of init_mm to *_populate functions"), which
replaced &init_mm with NULL and commit 59511cfd08f3 ("arm64: mm: use XN
table mapping attributes for user/kernel mappings"), which introduced
the VM_BUG_ON.

Since the former sounds reasonable, it is better to work on the later.
From the perspective of trans_pgd, two groups of functions are
considered in the later one:

  pmd_populate_kernel()
    mm == NULL should be fixed, else it hits VM_BUG_ON()
  p?d_populate()
    mm == NULL means PXN, that is OK, since trans_pgd only copies a
    linear map, no execution will happen on the map.

So it is good enough to just relax VM_BUG_ON() to disregard mm == NULL

Fixes: 59511cfd08f3 ("arm64: mm: use XN table mapping attributes for user/kernel mappings")
Cc: <redacted> # 5.13.x
Signed-off-by: Pingfan Liu <redacted>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Will Deacon <will@kernel.org>
Cc: Pasha Tatashin <pasha.tatashin@soleen.com>
Cc: James Morse <james.morse@arm.com>
Cc: Matthias Brugger <mbrugger@suse.com>
To: linux-arm-kernel@lists.infradead.org
It looks fine to me.

Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>

I'll leave it to Will to queue as a fix.

Thanks.

-- 
Catalin

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help