From nobody Mon Feb 9 16:47:08 2026 Received: from mail-10629.protonmail.ch (mail-10629.protonmail.ch [79.135.106.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 887B037BE9F for ; Mon, 12 Jan 2026 17:28:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=79.135.106.29 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768238913; cv=none; b=Fq1x3ltZk7z7kRRNzZaOs0BhoKJtJMXMo73iR+kkV8X3Zrtq3bA4j231iOvmB9xifLxbrosxSGVVatqVxIL/kH6N0jZeH/2oJfkr8CemWIlvZs2rA6UFAJVdgYvg0A7BabXGlDTPFRtVGwYs/JTMQjsJVoaDs4Se6OuEf5vLy5o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768238913; c=relaxed/simple; bh=bg/1Xgfn1E0DEXNbS9d/rzxNmu9VvpCFlIYq9KHMtu4=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=upICIwXwd6rkTJ+3lD6bMiy0H2JmOXs81u6+eavIAmS/hGKhEFvP2roGJWu7kTh6FngKY0kOTO/NFOwm/sMQAuNO9Q55qChHS0ZMXfUmlJ1HXsJzZ4bYtAgEsKKo3D3XMbMNRVEkxYIg5vYFJBVJFj73rRkG2VjWUVHz3X/cFNY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=pm.me; spf=pass smtp.mailfrom=pm.me; dkim=pass (2048-bit key) header.d=pm.me header.i=@pm.me header.b=neR07E+J; arc=none smtp.client-ip=79.135.106.29 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=pm.me Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pm.me Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pm.me header.i=@pm.me header.b="neR07E+J" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail3; t=1768238909; x=1768498109; bh=bg/1Xgfn1E0DEXNbS9d/rzxNmu9VvpCFlIYq9KHMtu4=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=neR07E+Jnlg+uKT0Q4Qubayl3FT+ONbfw/RQtxLwbd2s/UeKOK7bBvXT/+o/gc3tB kbhvs41hlEgd8Uj7zNq5O6gkUMYnsaA3PvC2ZeX4P2vC+ylJDxfhd9fO/ZjxTYLtsV 8fY3cwV5lOUDRQlUFEkA++Ghk4lynTDT/ftHTlcD0ZFc7Lv8otiP7h34gTOw2wpaw2 J5/VeWyUpG0URq+RWwtmDmfQkGvubSkNW2g6nTHXgTCm+BagDnnsBTP8vZP1lnqcpS Q/kKJWf/DTAeAPMq5km6HFPyUOaM5ih1ovjMRpVw0OxJE1DGb3rYQwaoJhb1UeHQqM Bv/t3y4sDB1DQ== Date: Mon, 12 Jan 2026 17:28:24 +0000 To: Catalin Marinas , Will Deacon From: Maciej Wieczor-Retman Cc: m.wieczorretman@pm.me, Maciej Wieczor-Retman , Alexander Potapenko , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v8 12/14] arm64: Unify software tag-based KASAN inline recovery path Message-ID: <85ee02ae536a4c2e95f7d2609c5893d99cd64a00.1768233085.git.m.wieczorretman@pm.me> In-Reply-To: References: Feedback-ID: 164464600:user:proton X-Pm-Message-ID: abd5dd7e650f6c0c9201b312154c351ebdd0b398 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Maciej Wieczor-Retman 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_die_unless_recover() function was added. Use kasan_die_unless_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 Acked-by: Catalin Marinas Acked-by: Alexander Potapenko --- Changelog v7: - Add Alexander's Acked-by tag. Changelog v6: - Add Catalin's Acked-by tag. 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 914282016069..e076753576e0 100644 --- a/arch/arm64/kernel/traps.c +++ b/arch/arm64/kernel/traps.c @@ -1071,22 +1071,7 @@ int kasan_brk_handler(struct pt_regs *regs, unsigned= long esr) =20 kasan_report(addr, size, write, pc); =20 - /* - * 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_die_unless_recover(recover, "Oops - KASAN", regs, esr, die); =20 /* If thread survives, skip over the brk instruction and continue: */ arm64_skip_faulting_instruction(regs, AARCH64_INSN_SIZE); --=20 2.52.0