[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fde443d0e67f76a51e7ab4e96647705840f53ddb.1738686764.git.maciej.wieczor-retman@intel.com>
Date: Tue, 4 Feb 2025 18:33:50 +0100
From: Maciej Wieczor-Retman <maciej.wieczor-retman@...el.com>
To: luto@...nel.org,
xin@...or.com,
kirill.shutemov@...ux.intel.com,
palmer@...belt.com,
tj@...nel.org,
andreyknvl@...il.com,
brgerst@...il.com,
ardb@...nel.org,
dave.hansen@...ux.intel.com,
jgross@...e.com,
will@...nel.org,
akpm@...ux-foundation.org,
arnd@...db.de,
corbet@....net,
maciej.wieczor-retman@...el.com,
dvyukov@...gle.com,
richard.weiyang@...il.com,
ytcoode@...il.com,
tglx@...utronix.de,
hpa@...or.com,
seanjc@...gle.com,
paul.walmsley@...ive.com,
aou@...s.berkeley.edu,
justinstitt@...gle.com,
jason.andryuk@....com,
glider@...gle.com,
ubizjak@...il.com,
jannh@...gle.com,
bhe@...hat.com,
vincenzo.frascino@....com,
rafael.j.wysocki@...el.com,
ndesaulniers@...gle.com,
mingo@...hat.com,
catalin.marinas@....com,
junichi.nomura@....com,
nathan@...nel.org,
ryabinin.a.a@...il.com,
dennis@...nel.org,
bp@...en8.de,
kevinloughlin@...gle.com,
morbo@...gle.com,
dan.j.williams@...el.com,
julian.stecklina@...erus-technology.de,
peterz@...radead.org,
cl@...ux.com,
kees@...nel.org
Cc: kasan-dev@...glegroups.com,
x86@...nel.org,
linux-arm-kernel@...ts.infradead.org,
linux-riscv@...ts.infradead.org,
linux-kernel@...r.kernel.org,
linux-mm@...ck.org,
llvm@...ts.linux.dev,
linux-doc@...r.kernel.org
Subject: [PATCH 09/15] x86: Physical address comparison in current_mm pgd check
With KASAN software tag-based mode enabled PGD pointer stored in
current_mm structure is tagged while the same pointer computed through
__va(read_cr3_pa()) ends up with the tag space filled with ones.
Use current_mm->pgd' physical address and drop the __va() so the
VM_WARN_ON_ONCE can work properly and not report false positives while
KASAN is enabled.
Signed-off-by: Maciej Wieczor-Retman <maciej.wieczor-retman@...el.com>
---
arch/x86/mm/tlb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c
index 86593d1b787d..95e3dc1fb766 100644
--- a/arch/x86/mm/tlb.c
+++ b/arch/x86/mm/tlb.c
@@ -1295,7 +1295,7 @@ bool nmi_uaccess_okay(void)
if (loaded_mm != current_mm)
return false;
- VM_WARN_ON_ONCE(current_mm->pgd != __va(read_cr3_pa()));
+ VM_WARN_ON_ONCE(__pa(current_mm->pgd) != read_cr3_pa());
return true;
}
--
2.47.1
Powered by blists - more mailing lists