From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (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 1E26F3A1A5F; Mon, 20 Apr 2026 14:27:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776695257; cv=none; b=FNab4GkmlWuc2ZG72qRz6G4+SZAQsBBQEJSmojBpacUB11vWHJkNvHHi7w/HLCxs0hOsELwPmF7ZtVlxD+d2odKE+fuWLV8VQq5a7RcxIpB3jG3wQPHvcXpmckNyAGQfuaLB8xAui9AUJDGduavvb/l9OEp8eWcO3U/Zd9LhiJk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776695257; c=relaxed/simple; bh=7iZB9lVR4tjlUQWISf4C9RaUtnMV6A5tolEZjLKPmq0=; h=Mime-Version:Content-Type:Date:Message-Id:From:To:Subject:Cc: References:In-Reply-To; b=MusF8iwW64mgnR/q0PuO72hAW3Q32MsJkOWybXfMxHvzTZ4lHctawTF3BdRO5Whykz5riDgFd8/z5MFkiiDKaLg/qTPModZdPX25iOy0Ab6d22JsJNqiZwodo8v1zq85egH/k6uWtIEsWLoiQguTd7294v81oHnib3JqzFn9Zuc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=cQx3iAWh; arc=none smtp.client-ip=185.246.85.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="cQx3iAWh" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 7518B4E42A74; Mon, 20 Apr 2026 14:27:33 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 4520E5FFA5; Mon, 20 Apr 2026 14:27:33 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id D76FA104609E1; Mon, 20 Apr 2026 16:27:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1776695251; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=7iZB9lVR4tjlUQWISf4C9RaUtnMV6A5tolEZjLKPmq0=; b=cQx3iAWhs/KPT6ZKsayEJ77QUJ33XBAG/t0wnqcTpu3msayl+KXgWefDzyP6FHZbfakEkZ mUR9idudII95auF9BStFdEyg/ZfrWZJCELMf6aEJ9nJnKcF3lYW4yWiIbwvmeXqGWTpGmf 6EF//PlEz9TgQjwnfV7Im08Tdi8PN2MJhTmQrHK3ZcYqVN+h4i1NR1PcJfySN2cwnhClDq 928UAmnD/sIgSbP085aDV8aYk/2N8juRaUClIP5Mya/PjkZy+fiJZcnNXxg9mz4R2m4w41 IRTL6ZhZmOioqx+JmCYgjuunP3yDG68/rxphRxpBvUN8z7Kr2df9dCBqhog1xw== Precedence: bulk X-Mailing-List: netdev@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 Date: Mon, 20 Apr 2026 16:27:19 +0200 Message-Id: From: =?utf-8?q?Alexis_Lothor=C3=A9?= To: "Alexei Starovoitov" , "Andrey Konovalov" Subject: Re: [PATCH RFC bpf-next 1/8] kasan: expose generic kasan helpers Cc: =?utf-8?q?Alexis_Lothor=C3=A9?= , "Alexei Starovoitov" , "Daniel Borkmann" , "Andrii Nakryiko" , "Martin KaFai Lau" , "Eduard Zingerman" , "Kumar Kartikeya Dwivedi" , "Song Liu" , "Yonghong Song" , "Jiri Olsa" , "John Fastabend" , "David S. Miller" , "David Ahern" , "Thomas Gleixner" , "Ingo Molnar" , "Borislav Petkov" , "Dave Hansen" , "X86 ML" , "H. Peter Anvin" , "Shuah Khan" , "Maxime Coquelin" , "Alexandre Torgue" , "Andrey Ryabinin" , "Alexander Potapenko" , "Dmitry Vyukov" , "Vincenzo Frascino" , "Andrew Morton" , , "Bastien Curutchet" , "Thomas Petazzoni" , "Xu Kuohai" , "bpf" , "LKML" , "Network Development" , "open list:KERNEL SELFTEST FRAMEWORK" , , "linux-arm-kernel" , "kasan-dev" , "linux-mm" X-Mailer: aerc 0.21.0-0-g5549850facc2 References: <20260413-kasan-v1-0-1a5831230821@bootlin.com> <20260413-kasan-v1-1-1a5831230821@bootlin.com> In-Reply-To: X-Last-TLS-Session-Version: TLSv1.3 On Mon Apr 20, 2026 at 12:51 AM CEST, Alexei Starovoitov wrote: > On Sun, Apr 19, 2026 at 2:49=E2=80=AFPM Andrey Konovalov wrote: >> >> On Tue, Apr 14, 2026 at 5:58=E2=80=AFPM Alexei Starovoitov >> wrote: >> > >> > I think we're talking past each other. >> > We're not interested in KASAN_SW_TAGS or KASAN_HW_TAGS. >> > We're not going to modify arm64 JIT at all. >> > >> > This is purely KASAN_GENRIC and only on x86-64. >> > JIT will emit exactly what compilers emit for generic >> > which is __asan_load/store. This is as stable ABI as it can get >> > and we don't want to deviate from it. >> >> OK, I supposed that's fair. You did throw me off point with your >> performance comment. But if you decide to add SW_TAGS support at some >> point, I think this discussion needs to be revisited. >> >> But please add a comment saying that those functions are only exposed >> for BPF JIT and they are not supposed to be used by other parts of the >> kernel. And in case you do end up adding a new config option, guard >> the public declarations by a corresponding ifdef. > > I feel concerns of misuse are overblown. > Being in include/linux/kasan.h doesn't make them free-for-all > all of a sudden, but if you prefer we can just copy paste: > +void __asan_load1(void *p); > +void __asan_store1(void *p); > into bpf_jit_comp.c That's actually what I initially went with when working on this, but it did look a bit fragile, and suspected that I would rather be asked to expor= t them properly through a dedicated header. I'm fine with putting back the manual declarations in jit comp, though. > >> > The goal here is to find bugs in the verifier. >> > If something got past it, that shouldn't have, >> > kasan generic on x86-64 is enough. >> >> FWIW, I suspect HW_TAGS KASAN already just works with JITed BPF code. > > Ohh. Good point. Looks like modern arm64 cpus in public clouds > don't have that enabled, so one would need pixel phone to > catch verifier bugs via hw_tags. > So we still need this x86-specific jit kasan. > I guess eventually it can be removed when hw_tags support is widespread. --=20 Alexis Lothor=C3=A9, Bootlin Embedded Linux and Kernel engineering https://bootlin.com