From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Will Deacon <will@kernel.org>,
Andrey Konovalov <andreyknvl@gmail.com>,
Mark Rutland <mark.rutland@arm.com>,
syzbot+908886656a02769af987@syzkaller.appspotmail.com,
Sasha Levin <sashal@kernel.org>,
ryabinin.a.a@gmail.com, nathan@kernel.org,
kasan-dev@googlegroups.com, llvm@lists.linux.dev
Subject: [PATCH AUTOSEL 6.11 23/30] kasan: Disable Software Tag-Based KASAN with GCC
Date: Wed, 23 Oct 2024 10:29:48 -0400 [thread overview]
Message-ID: <20241023143012.2980728-23-sashal@kernel.org> (raw)
In-Reply-To: <20241023143012.2980728-1-sashal@kernel.org>
From: Will Deacon <will@kernel.org>
[ Upstream commit 7aed6a2c51ffc97a126e0ea0c270fab7af97ae18 ]
Syzbot reports a KASAN failure early during boot on arm64 when building
with GCC 12.2.0 and using the Software Tag-Based KASAN mode:
| BUG: KASAN: invalid-access in smp_build_mpidr_hash arch/arm64/kernel/setup.c:133 [inline]
| BUG: KASAN: invalid-access in setup_arch+0x984/0xd60 arch/arm64/kernel/setup.c:356
| Write of size 4 at addr 03ff800086867e00 by task swapper/0
| Pointer tag: [03], memory tag: [fe]
Initial triage indicates that the report is a false positive and a
thorough investigation of the crash by Mark Rutland revealed the root
cause to be a bug in GCC:
> When GCC is passed `-fsanitize=hwaddress` or
> `-fsanitize=kernel-hwaddress` it ignores
> `__attribute__((no_sanitize_address))`, and instruments functions
> we require are not instrumented.
>
> [...]
>
> All versions [of GCC] I tried were broken, from 11.3.0 to 14.2.0
> inclusive.
>
> I think we have to disable KASAN_SW_TAGS with GCC until this is
> fixed
Disable Software Tag-Based KASAN when building with GCC by making
CC_HAS_KASAN_SW_TAGS depend on !CC_IS_GCC.
Cc: Andrey Konovalov <andreyknvl@gmail.com>
Suggested-by: Mark Rutland <mark.rutland@arm.com>
Reported-by: syzbot+908886656a02769af987@syzkaller.appspotmail.com
Link: https://lore.kernel.org/r/000000000000f362e80620e27859@google.com
Link: https://lore.kernel.org/r/ZvFGwKfoC4yVjN_X@J2N7QTR9R3
Link: https://bugzilla.kernel.org/show_bug.cgi?id=218854
Reviewed-by: Andrey Konovalov <andreyknvl@gmail.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Link: https://lore.kernel.org/r/20241014161100.18034-1-will@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
lib/Kconfig.kasan | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/lib/Kconfig.kasan b/lib/Kconfig.kasan
index 98016e137b7f0..233ab20969242 100644
--- a/lib/Kconfig.kasan
+++ b/lib/Kconfig.kasan
@@ -22,8 +22,11 @@ config ARCH_DISABLE_KASAN_INLINE
config CC_HAS_KASAN_GENERIC
def_bool $(cc-option, -fsanitize=kernel-address)
+# GCC appears to ignore no_sanitize_address when -fsanitize=kernel-hwaddress
+# is passed. See https://bugzilla.kernel.org/show_bug.cgi?id=218854 (and
+# the linked LKML thread) for more details.
config CC_HAS_KASAN_SW_TAGS
- def_bool $(cc-option, -fsanitize=kernel-hwaddress)
+ def_bool !CC_IS_GCC && $(cc-option, -fsanitize=kernel-hwaddress)
# This option is only required for software KASAN modes.
# Old GCC versions do not have proper support for no_sanitize_address.
@@ -98,7 +101,7 @@ config KASAN_SW_TAGS
help
Enables Software Tag-Based KASAN.
- Requires GCC 11+ or Clang.
+ Requires Clang.
Supported only on arm64 CPUs and relies on Top Byte Ignore.
--
2.43.0
next prev parent reply other threads:[~2024-10-23 14:30 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-23 14:29 [PATCH AUTOSEL 6.11 01/30] 9p: v9fs_fid_find: also lookup by inode if not found dentry Sasha Levin
2024-10-23 14:29 ` [PATCH AUTOSEL 6.11 02/30] 9p: Avoid creating multiple slab caches with the same name Sasha Levin
2024-10-23 14:29 ` [PATCH AUTOSEL 6.11 03/30] selftests/bpf: Verify that sync_linked_regs preserves subreg_def Sasha Levin
2024-10-23 14:29 ` [PATCH AUTOSEL 6.11 04/30] nvmet-passthru: clear EUID/NGUID/UUID while using loop target Sasha Levin
2024-10-23 14:29 ` [PATCH AUTOSEL 6.11 05/30] irqchip/ocelot: Fix trigger register address Sasha Levin
2024-10-23 14:29 ` [PATCH AUTOSEL 6.11 06/30] pinctrl: aw9523: add missing mutex_destroy Sasha Levin
2024-10-23 14:29 ` [PATCH AUTOSEL 6.11 07/30] pinctrl: intel: platform: Add Panther Lake to the list of supported Sasha Levin
2024-10-23 14:29 ` [PATCH AUTOSEL 6.11 08/30] nvme: tcp: avoid race between queue_lock lock and destroy Sasha Levin
2024-10-23 14:29 ` [PATCH AUTOSEL 6.11 09/30] block: Fix elevator_get_default() checking for NULL q->tag_set Sasha Levin
2024-10-23 14:29 ` [PATCH AUTOSEL 6.11 10/30] HID: multitouch: Add support for B2402FVA track point Sasha Levin
2024-10-23 14:29 ` [PATCH AUTOSEL 6.11 11/30] HID: multitouch: Add quirk for HONOR MagicBook Art 14 touchpad Sasha Levin
2024-10-23 14:29 ` [PATCH AUTOSEL 6.11 12/30] iommu/arm-smmu: Clarify MMU-500 CPRE workaround Sasha Levin
2024-10-23 14:29 ` [PATCH AUTOSEL 6.11 13/30] nvme: disable CC.CRIME (NVME_CC_CRIME) Sasha Levin
2024-10-23 14:29 ` [PATCH AUTOSEL 6.11 14/30] bpf: use kvzmalloc to allocate BPF verifier environment Sasha Levin
2024-10-23 14:29 ` [PATCH AUTOSEL 6.11 15/30] crypto: api - Fix liveliness check in crypto_alg_tested Sasha Levin
2024-10-23 14:29 ` [PATCH AUTOSEL 6.11 16/30] crypto: marvell/cesa - Disable hash algorithms Sasha Levin
2024-10-23 14:29 ` [PATCH AUTOSEL 6.11 17/30] s390/ap: Fix CCA crypto card behavior within protected execution environment Sasha Levin
2024-10-23 14:29 ` [PATCH AUTOSEL 6.11 18/30] sound: Make CONFIG_SND depend on INDIRECT_IOMEM instead of UML Sasha Levin
2024-10-23 14:29 ` [PATCH AUTOSEL 6.11 19/30] drm/vmwgfx: Limit display layout ioctl array size to VMWGFX_NUM_DISPLAY_UNITS Sasha Levin
2024-10-23 14:29 ` [PATCH AUTOSEL 6.11 20/30] selftests/bpf: Assert link info uprobe_multi count & path_size if unset Sasha Levin
2024-10-23 14:29 ` [PATCH AUTOSEL 6.11 21/30] RDMA/siw: Add sendpage_ok() check to disable MSG_SPLICE_PAGES Sasha Levin
2024-10-23 14:29 ` [PATCH AUTOSEL 6.11 22/30] ALSA: hda/tas2781: Add new quirk for Lenovo, ASUS, Dell projects Sasha Levin
2024-10-23 14:29 ` Sasha Levin [this message]
2024-10-23 14:29 ` [PATCH AUTOSEL 6.11 24/30] nvme-multipath: defer partition scanning Sasha Levin
2024-10-23 14:29 ` [PATCH AUTOSEL 6.11 25/30] drm/amdkfd: Accounting pdd vram_usage for svm Sasha Levin
2024-10-23 14:29 ` [PATCH AUTOSEL 6.11 26/30] powerpc/powernv: Free name on error in opal_event_init() Sasha Levin
2024-10-23 14:29 ` [PATCH AUTOSEL 6.11 27/30] net: phy: mdio-bcm-unimac: Add BCM6846 support Sasha Levin
2024-10-23 14:29 ` [PATCH AUTOSEL 6.11 28/30] drm/xe/query: Increase timestamp width Sasha Levin
2024-10-23 14:29 ` [PATCH AUTOSEL 6.11 29/30] nvme-loop: flush off pending I/O while shutting down loop controller Sasha Levin
2024-10-23 14:29 ` [PATCH AUTOSEL 6.11 30/30] nvme: make keep-alive synchronous operation Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241023143012.2980728-23-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=andreyknvl@gmail.com \
--cc=kasan-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=mark.rutland@arm.com \
--cc=nathan@kernel.org \
--cc=ryabinin.a.a@gmail.com \
--cc=stable@vger.kernel.org \
--cc=syzbot+908886656a02769af987@syzkaller.appspotmail.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.