From patchwork Thu Jul 25 23:20:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Maurer X-Patchwork-Id: 13742205 Received: from mail-pg1-f201.google.com (mail-pg1-f201.google.com [209.85.215.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 043C8149009 for ; Thu, 25 Jul 2024 23:21:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721949706; cv=none; b=R6CrgozaV5GQo7nfZUeoPbERPbFxj1j3u2cAHOrFvL1+rYZiv4OCIEIQ8m2MFlqDey1SfwEgCpgfBLF2FxnYdurPsxYKZMH7jWLhsf//isa4qiemgYJkwI2ihxjmYqjxezTD6r328VAQBh3Exf2rIurpyw/+mxy9bJe5PwW2L+c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721949706; c=relaxed/simple; bh=ZKaF/D01LQsHjAvoedlEW93oVhWFVCMFh6KAZt0Po2U=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=HzfqRmW9/L2YwvL019j+vCMmX9jRK1qBlzInQHPupxl+YkL9+Lk4GT+OMKnbGB3bOtoYz+niVUXd0Z60c6GKcCiafgqY6BecrRCwUCH8nKhwB6dU0PqAvxmhRfhKsh2ZunsDywG9iPJk+8duqXNNSbqO6E9DThIFUSItwahimK4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--mmaurer.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=iUB+V1cu; arc=none smtp.client-ip=209.85.215.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--mmaurer.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="iUB+V1cu" Received: by mail-pg1-f201.google.com with SMTP id 41be03b00d2f7-78fad6425c1so357208a12.2 for ; Thu, 25 Jul 2024 16:21:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1721949704; x=1722554504; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=y13cefxKDwFOzGl/kd1oLgkzNPir8kAC6sYxj1AUEz8=; b=iUB+V1cuhhXYq3f6SYiCQbmKSti7ZtfmhOWJ0f1V2RSD/TYW96twZxMgJGY9EPU3Jx rP1LR3jECrGu1uEgVFP3gAnkbQuWtqE9sZgAzadj4pMtLe3bx7NxHsWoMMTot2kaPY/l /AO0E3uJiqqGSvGTNi6hjUsPESUCjpkq8qOuUSDpCYPnfdsrpyftEbwNthIUrFeiDmVW 4jxL0YS2jYL2FjeHyheDFVY04DTS6pxFuktE7nFapDxsN3W6O6KG9xAkIVwjZnWEUH3N 7Daf9E/bpET7cHUb9vRA4CsBDRQNnqDue9aVy+7B2DynIXqaQZEzlTk2+8SKnr4v4snM JnJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721949704; x=1722554504; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=y13cefxKDwFOzGl/kd1oLgkzNPir8kAC6sYxj1AUEz8=; b=iIkyftt2fCPff82VKvjVEyAxkXNrYsLV0G35wd0R42M/k6OyIY9KFpX1fs4F4bAdMb 2gx6Ng3+y6gDp+LJkhIWw0nbvhBDImk8ph1daFT5qpxIFP9BFCa3sCxWQ/LFJ1ub7CSp sAHPULhAPDTLBY5/mUtVs0IvXM8fqLcYn4y9hZO1SkorEl2rqwIiym9CynfAQaI4a62u O/+MkgEzCoeJvrp1v0dpvewO0VLGfFiYzsnvk1AEKYlNsYSvxMOU/Q9kpsU0TUwbQRBc /0yEpA3SAaPfchsstoNgkqbXybgkrbM75V0oe38M+uTfgmod+14IoPlcVL1ouljzk45I d1gw== X-Forwarded-Encrypted: i=1; AJvYcCW8OsIhAAJhyV2WaDP2buJ2JNKfr+kdpTMESmRYH2Hj9i3EfTW7PvQiU9yoQzs/OzRVCpijmMmTgKwBGBex0CQ1UUCe2DgFuGKEDs78 X-Gm-Message-State: AOJu0YzHLkUzFpA52EE0Gsfl51G0YwHbZyIaDLL5UQKsb3oDCU13ixY7 jnp6WgZJs5gFNKsMzz4Hsx+3GeaJZ0L/3Tg/4JeRZwP9Pe4gs0A26p+fYmCG/KL2o/Z50wqoZXH 76xXmdw== X-Google-Smtp-Source: AGHT+IHjrE954mcIGIRH54e2mts+0YSZZYtNHD5+2mBbyQ/nTzFDy9aH2ICIt5W6uuPPduDm1v2e1Bn5ggyW X-Received: from anyblade.c.googlers.com ([fda3:e722:ac3:cc00:20:ed76:c0a8:1791]) (user=mmaurer job=sendgmr) by 2002:a05:6a02:488:b0:721:414f:189a with SMTP id 41be03b00d2f7-7a9c7a67420mr8182a12.4.1721949703919; Thu, 25 Jul 2024 16:21:43 -0700 (PDT) Date: Thu, 25 Jul 2024 23:20:46 +0000 In-Reply-To: <20240725232126.1996981-1-mmaurer@google.com> Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240725232126.1996981-1-mmaurer@google.com> X-Mailer: git-send-email 2.46.0.rc1.232.g9752f9e123-goog Message-ID: <20240725232126.1996981-2-mmaurer@google.com> Subject: [PATCH 1/2] kbuild: rust: Define probing macros for rustc From: Matthew Maurer To: Masahiro Yamada , Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Nathan Chancellor Cc: Matthew Maurer , Nicolas Schier , Boqun Feng , Gary Guo , " =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= " , Benno Lossin , Andreas Hindborg , Alice Ryhl , Nick Desaulniers , Bill Wendling , Justin Stitt , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, llvm@lists.linux.dev Creates flag probe macro variants for `rustc`. These are helpful because: 1. `rustc` support will soon be a minimum rather than a pinned version. 2. We already support multiple LLVMs linked into `rustc`, and these are needed to probe what LLVM parameters `rustc` will accept. Signed-off-by: Matthew Maurer --- scripts/Kconfig.include | 8 ++++++++ scripts/Makefile.compiler | 15 +++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/scripts/Kconfig.include b/scripts/Kconfig.include index 3ee8ecfb8c04..ffafe269fe9e 100644 --- a/scripts/Kconfig.include +++ b/scripts/Kconfig.include @@ -63,3 +63,11 @@ ld-version := $(shell,set -- $(ld-info) && echo $2) cc-option-bit = $(if-success,$(CC) -Werror $(1) -E -x c /dev/null -o /dev/null,$(1)) m32-flag := $(cc-option-bit,-m32) m64-flag := $(cc-option-bit,-m64) + +# $(rustc-option,) +# Return y if the Rust compiler supports , n otherwise +# Calls to this should be guarded so that they are not evaluated if +# CONFIG_HAVE_RUST is not set. +# If you are testing for unstable features, consider `rustc-min-version` +# instead, as features may have different completeness while available. +rustc-option = $(success,trap "rm -rf .tmp_$$" EXIT; mkdir .tmp_$$; $(RUSTC) $(1) --crate-type=rlib /dev/null -o .tmp_$$/tmp.rlib) diff --git a/scripts/Makefile.compiler b/scripts/Makefile.compiler index 92be0c9a13ee..485d66768a32 100644 --- a/scripts/Makefile.compiler +++ b/scripts/Makefile.compiler @@ -72,3 +72,18 @@ clang-min-version = $(call test-ge, $(CONFIG_CLANG_VERSION), $1) # ld-option # Usage: KBUILD_LDFLAGS += $(call ld-option, -X, -Y) ld-option = $(call try-run, $(LD) $(KBUILD_LDFLAGS) $(1) -v,$(1),$(2),$(3)) + +# __rustc-option +# Usage: MY_RUSTFLAGS += $(call __rustc-option,$(RUSTC),$(MY_RUSTFLAGS),-Cinstrument-coverage,-Zinstrument-coverage) +__rustc-option = $(call try-run,\ + $(1) $(2) $(3) --crate-type=rlib /dev/null -o "$$TMP",$(3),$(4)) + +# rustc-option +# Usage: rustflags-y += $(call rustc-option,-Cinstrument-coverage,-Zinstrument-coverage) +rustc-option = $(call __rustc-option, $(RUSTC),\ + $(KBUILD_RUSTFLAGS),$(1),$(2)) + +# rustc-option-yn +# Usage: flag := $(call rustc-option-yn,-Cinstrument-coverage) +rustc-option-yn = $(call try-run,\ + $(RUSTC) $(KBUILD_RUSTFLAGS) $(1) --crate-type=rlib /dev/null -o "$$TMP",y,n) From patchwork Thu Jul 25 23:20:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Maurer X-Patchwork-Id: 13742206 Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5E61314900B for ; Thu, 25 Jul 2024 23:21:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721949709; cv=none; b=hzqsP3d3JQkyDCklq0dv1A8tDqH9hTVl6abzLTGIwawwS17V1UQ1cjoVQYhBpK51Vgy/Ee3evUa9tebywKH/oSzvM7auJpzqUc5XgqGZPNM/Meq4SPBBpRF001Lzjpci5Ax0VNKo7jeb73AXJTMeCNyEGwy5ulRTnyF/UcNYwhA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721949709; c=relaxed/simple; bh=qH2ob/GPMxW6QjGdFk/NsUTwDcqVg3OStezb0PUZxuM=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=kfyKRqAxJUKUwVGlvWmcN6s9+s3rWSWM3TcCexLUd+n9C0fHXXJ/eVPImvupCiFsBbo1eP92LrSGb5DHyON//khk+jsbr+e75OtnxO3836SEPmyGu7fp6I5/eDIgOm4awqfbecvk59+c4AZmS7KnlR0ej7PaKAAjAt0dNzW7gGY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--mmaurer.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=EhfPFJ/i; arc=none smtp.client-ip=209.85.219.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--mmaurer.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="EhfPFJ/i" Received: by mail-yb1-f201.google.com with SMTP id 3f1490d57ef6-e0b2fb62a07so1917659276.0 for ; Thu, 25 Jul 2024 16:21:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1721949706; x=1722554506; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=NIeg3QD3T42p/ZQnVld0CvS5klyquBslVZ8Cnqk2AWw=; b=EhfPFJ/iwj+esBuZUYJmS4jht5pSWcH9MfTXEkMQR9C72PhRc+nCdZm2/xtWc0A59a t4fu1eD+t63e6ijVwoU+8FJJ/Id5MJfyLcR4DHyvnASJ7kOZOu7GZBuZmfnvyHvbRoKh nwWv1SoP9xk9xYMjFVGL6BJrKeXhp51d15E0ERCKOGI+zuwigkUJ8Hn+CoZyr3TYZ28j iPOJv8KNs6Ioh5jxXDZsRq7Zm05Bxg4qs2Rtl/cXAil5uk0PceTMsaiJmE7s4v9BAJSw DMr4k2pWqAmwCEjtmfD81WMlRL+Nws6Ps8+yDoEWFnhGVy30OaEUDPOsqmRe61tpWVJ+ wfqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721949706; x=1722554506; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=NIeg3QD3T42p/ZQnVld0CvS5klyquBslVZ8Cnqk2AWw=; b=MXJ9Waa99Lvst960WOtXf1Iiyegh/AVMo1hcvL+61p1GNDXcJ1LcYlXT57M1xHmT4g UzjoPMzAo8qNR/qCdisEicxyRJ1JQycCZmqTkeWz8T/hz3FXeg0iHYxZC6It69qH1/Xd hCb6YyDLy+uBKPktWqVTebBBNTw2WuMpeRSTX4AANHPnqwmCNg2ftNBcpznM/0qBfnsF diqR6krFFgj8Zuxb9RnvYC1nGhn29aH85sc+w4R4jsYlSp3m3bk6zRVp8fjw9uTw0nj5 8sOMeEKTZOeQGp0jvuce7ob6pfaN8yEsWcgFOBbn1p0bPfGDktuHB0ZITh8BN6runHim 4cXQ== X-Forwarded-Encrypted: i=1; AJvYcCU4mRgM6V+Z/5pjhyN9ho4KWD53d1lfQd6ND780aKhBglu8u5fvk+NyNZot/8rnz0DAcavOAVeM8QdMCJaezV+s5iK/p0LZvsXVwVST X-Gm-Message-State: AOJu0YySB5ts/9TXgB1d1Xtogay5gy7iHH8PCUKFZMkvSa5M6IDAaBy5 dIRtVao4N4fRtsuB7PZPlWvKcFfToEXP4vp48GuqioCuvNqJKqmJQ0M0TqfswYoXI42fyQuFHg9 ojsPwZw== X-Google-Smtp-Source: AGHT+IGFgF07K78Xk6HyAkYV734bKuaNSlYnh+LI6ONN4gJdXx4TMFBTavf54CUZ0w26vWpdASB/dVOetoAt X-Received: from anyblade.c.googlers.com ([fda3:e722:ac3:cc00:20:ed76:c0a8:1791]) (user=mmaurer job=sendgmr) by 2002:a25:9bc1:0:b0:e08:6c33:7334 with SMTP id 3f1490d57ef6-e0b2cd29922mr30221276.8.1721949706306; Thu, 25 Jul 2024 16:21:46 -0700 (PDT) Date: Thu, 25 Jul 2024 23:20:47 +0000 In-Reply-To: <20240725232126.1996981-1-mmaurer@google.com> Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240725232126.1996981-1-mmaurer@google.com> X-Mailer: git-send-email 2.46.0.rc1.232.g9752f9e123-goog Message-ID: <20240725232126.1996981-3-mmaurer@google.com> Subject: [PATCH 2/2] kbuild: rust: Enable KASAN support From: Matthew Maurer To: Andrey Ryabinin , Masahiro Yamada , Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Nathan Chancellor Cc: Matthew Maurer , Alexander Potapenko , Andrey Konovalov , Dmitry Vyukov , Vincenzo Frascino , Nicolas Schier , Boqun Feng , Gary Guo , " =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= " , Benno Lossin , Andreas Hindborg , Alice Ryhl , Nick Desaulniers , Bill Wendling , Justin Stitt , kasan-dev@googlegroups.com, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, llvm@lists.linux.dev Rust supports KASAN via LLVM, but prior to this patch, the flags aren't set properly. Suggested-by: Miguel Ojeda Signed-off-by: Matthew Maurer --- scripts/Makefile.kasan | 46 +++++++++++++++++++++++++++++++++++++++++- scripts/Makefile.lib | 3 +++ 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/scripts/Makefile.kasan b/scripts/Makefile.kasan index 390658a2d5b7..84572c473e23 100644 --- a/scripts/Makefile.kasan +++ b/scripts/Makefile.kasan @@ -12,6 +12,7 @@ endif KASAN_SHADOW_OFFSET ?= $(CONFIG_KASAN_SHADOW_OFFSET) cc-param = $(call cc-option, -mllvm -$(1), $(call cc-option, --param $(1))) +rustc-param = $(call rustc-option, -Cllvm-args=-$(1),) ifdef CONFIG_KASAN_STACK stack_enable := 1 @@ -28,6 +29,7 @@ else endif CFLAGS_KASAN_MINIMAL := -fsanitize=kernel-address +RUSTFLAGS_KASAN_MINIMAL := -Zsanitizer=kernel-address -Zsanitizer-recover=kernel-address # -fasan-shadow-offset fails without -fsanitize CFLAGS_KASAN_SHADOW := $(call cc-option, -fsanitize=kernel-address \ @@ -36,13 +38,36 @@ CFLAGS_KASAN_SHADOW := $(call cc-option, -fsanitize=kernel-address \ -mllvm -asan-mapping-offset=$(KASAN_SHADOW_OFFSET))) ifeq ($(strip $(CFLAGS_KASAN_SHADOW)),) + KASAN_SHADOW_SUPPORTED := n +else + KASAN_SHADOW_SUPPORTED := y +endif + +ifdef CONFIG_RUST + RUSTFLAGS_KASAN_SHADOW := $(call rustc-option $(RUSTFLAGS_KASAN_MINIMAL) \ + -Cllvm-args=-asan-mapping-offset=$(KASAN_SHADOW_OFFSET)) + ifeq ($(strip $(RUSTFLAGS_KASAN_SHADOW)),) + KASAN_SHADOW_SUPPORTED := n + endif +endif + +ifeq ($(KASAN_SHADOW_SUPPORTED),y) CFLAGS_KASAN := $(CFLAGS_KASAN_MINIMAL) + ifdef CONFIG_RUST + RUSTFLAGS_KASAN := $(RUSTFLAGS_KASAN_MINIMAL) + endif else # Now add all the compiler specific options that are valid standalone CFLAGS_KASAN := $(CFLAGS_KASAN_SHADOW) \ $(call cc-param,asan-globals=1) \ $(call cc-param,asan-instrumentation-with-call-threshold=$(call_threshold)) \ $(call cc-param,asan-instrument-allocas=1) + ifdef CONFIG_RUST + RUSTFLAGS_KASAN := $(RUSTFLAGS_KASAN_SHADOW) \ + $(call rustc-param,asan-globals=1) \ + $(call rustc-param,asan-instrumentation-with-call-threshold=$(call_threshold)) \ + $(call rustc-param,asan-instrument-allocas=1) + endif endif CFLAGS_KASAN += $(call cc-param,asan-stack=$(stack_enable)) @@ -52,6 +77,11 @@ CFLAGS_KASAN += $(call cc-param,asan-stack=$(stack_enable)) # memintrinsics won't be checked by KASAN on GENERIC_ENTRY architectures. CFLAGS_KASAN += $(call cc-param,asan-kernel-mem-intrinsic-prefix=1) +ifdef CONFIG_RUST + RUSTFLAGS_KASAN += $(call rustc-param,asan-stack=$(stack_enable)) + RUSTFLAGS_KASAN += $(call rustc-param,asan-kernel-mem-intrinsic-prefix=1) +endif + endif # CONFIG_KASAN_GENERIC ifdef CONFIG_KASAN_SW_TAGS @@ -73,6 +103,20 @@ ifeq ($(call clang-min-version, 150000)$(call gcc-min-version, 130000),y) CFLAGS_KASAN += $(call cc-param,hwasan-kernel-mem-intrinsic-prefix=1) endif +ifdef CONFIG_RUST + ifdef CONFIG_KASAN_INLINE + rust_instrumentation_flags := $(call rustc-param,hwasan-mapping-offset=$(KASAN_SHADOW_OFFSET)) + else + rust_instrumentation_flags := $(call rustc-param,hwasan-instrument-with-calls=1) + endif + RUSTFLAGS_KASAN := -Zsanitizer=kernel-hwaddress -Zsanitizer-recover=kernel-hwaddress \ + $(call rustc-param,hwasan-instrument-stack=$(stack_enable)) \ + $(call rustc-param,hwasan-use-short-granules=0) \ + $(call rustc-param,hwasan-inline-all-checks=0) \ + $(call rustc-param,hwasan-kernel-mem-intrinsic-prefix=1) \ + $(instrumentation_flags) +endif + endif # CONFIG_KASAN_SW_TAGS -export CFLAGS_KASAN CFLAGS_KASAN_NOSANITIZE +export CFLAGS_KASAN CFLAGS_KASAN_NOSANITIZE RUSTFLAGS_KASAN diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 9f06f6aaf7fc..4a58636705e0 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -167,6 +167,9 @@ ifneq ($(CONFIG_KASAN_HW_TAGS),y) _c_flags += $(if $(patsubst n%,, \ $(KASAN_SANITIZE_$(target-stem).o)$(KASAN_SANITIZE)$(is-kernel-object)), \ $(CFLAGS_KASAN), $(CFLAGS_KASAN_NOSANITIZE)) +_rust_flags += $(if $(patsubst n%,, \ + $(KASAN_SANITIZE_$(target-stem).o)$(KASAN_SANITIZE)$(is-kernel-object)), \ + $(RUSTFLAGS_KASAN)) endif endif