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: <eb073b008b547cf87722390cc94fe6e9d21c514e.1756151769.git.maciej.wieczor-retman@intel.com>
Date: Mon, 25 Aug 2025 22:24:39 +0200
From: Maciej Wieczor-Retman <maciej.wieczor-retman@...el.com>
To: sohil.mehta@...el.com,
	baohua@...nel.org,
	david@...hat.com,
	kbingham@...nel.org,
	weixugc@...gle.com,
	Liam.Howlett@...cle.com,
	alexandre.chartre@...cle.com,
	kas@...nel.org,
	mark.rutland@....com,
	trintaeoitogc@...il.com,
	axelrasmussen@...gle.com,
	yuanchu@...gle.com,
	joey.gouly@....com,
	samitolvanen@...gle.com,
	joel.granados@...nel.org,
	graf@...zon.com,
	vincenzo.frascino@....com,
	kees@...nel.org,
	ardb@...nel.org,
	thiago.bauermann@...aro.org,
	glider@...gle.com,
	thuth@...hat.com,
	kuan-ying.lee@...onical.com,
	pasha.tatashin@...een.com,
	nick.desaulniers+lkml@...il.com,
	vbabka@...e.cz,
	kaleshsingh@...gle.com,
	justinstitt@...gle.com,
	catalin.marinas@....com,
	alexander.shishkin@...ux.intel.com,
	samuel.holland@...ive.com,
	dave.hansen@...ux.intel.com,
	corbet@....net,
	xin@...or.com,
	dvyukov@...gle.com,
	tglx@...utronix.de,
	scott@...amperecomputing.com,
	jason.andryuk@....com,
	morbo@...gle.com,
	nathan@...nel.org,
	lorenzo.stoakes@...cle.com,
	mingo@...hat.com,
	brgerst@...il.com,
	kristina.martsenko@....com,
	bigeasy@...utronix.de,
	luto@...nel.org,
	jgross@...e.com,
	jpoimboe@...nel.org,
	urezki@...il.com,
	mhocko@...e.com,
	ada.coupriediaz@....com,
	hpa@...or.com,
	maciej.wieczor-retman@...el.com,
	leitao@...ian.org,
	peterz@...radead.org,
	wangkefeng.wang@...wei.com,
	surenb@...gle.com,
	ziy@...dia.com,
	smostafa@...gle.com,
	ryabinin.a.a@...il.com,
	ubizjak@...il.com,
	jbohac@...e.cz,
	broonie@...nel.org,
	akpm@...ux-foundation.org,
	guoweikang.kernel@...il.com,
	rppt@...nel.org,
	pcc@...gle.com,
	jan.kiszka@...mens.com,
	nicolas.schier@...ux.dev,
	will@...nel.org,
	andreyknvl@...il.com,
	jhubbard@...dia.com,
	bp@...en8.de
Cc: x86@...nel.org,
	linux-doc@...r.kernel.org,
	linux-mm@...ck.org,
	llvm@...ts.linux.dev,
	linux-kbuild@...r.kernel.org,
	kasan-dev@...glegroups.com,
	linux-kernel@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org
Subject: [PATCH v5 14/19] arm64: Unify software tag-based KASAN inline recovery path

To avoid having a copy of a long comment explaining the intricacies of
the inline KASAN recovery system and issues for every architecture that
uses the software tag-based mode, a unified kasan_inline_recover()
function was added.

Use kasan_inline_recover() in the kasan brk handler to cleanup the long
comment, that's kept in the non-arch KASAN code.

Signed-off-by: Maciej Wieczor-Retman <maciej.wieczor-retman@...el.com>
---
Changelog v5:
- Split arm64 portion of patch 13/18 into this one. (Peter Zijlstra)

 arch/arm64/kernel/traps.c | 17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)

diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
index f528b6041f6a..fe3c0104fe31 100644
--- a/arch/arm64/kernel/traps.c
+++ b/arch/arm64/kernel/traps.c
@@ -1068,22 +1068,7 @@ int kasan_brk_handler(struct pt_regs *regs, unsigned long esr)
 
 	kasan_report(addr, size, write, pc);
 
-	/*
-	 * The instrumentation allows to control whether we can proceed after
-	 * a crash was detected. This is done by passing the -recover flag to
-	 * the compiler. Disabling recovery allows to generate more compact
-	 * code.
-	 *
-	 * Unfortunately disabling recovery doesn't work for the kernel right
-	 * now. KASAN reporting is disabled in some contexts (for example when
-	 * the allocator accesses slab object metadata; this is controlled by
-	 * current->kasan_depth). All these accesses are detected by the tool,
-	 * even though the reports for them are not printed.
-	 *
-	 * This is something that might be fixed at some point in the future.
-	 */
-	if (!recover)
-		die("Oops - KASAN", regs, esr);
+	kasan_inline_recover(recover, "Oops - KASAN", regs, esr, die);
 
 	/* If thread survives, skip over the brk instruction and continue: */
 	arm64_skip_faulting_instruction(regs, AARCH64_INSN_SIZE);
-- 
2.50.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ