rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
To: Matthew Maurer <mmaurer@google.com>
Cc: andreyknvl@gmail.com, ojeda@kernel.org,
	"Alex Gaynor" <alex.gaynor@gmail.com>,
	"Wedson Almeida Filho" <wedsonaf@gmail.com>,
	"Nathan Chancellor" <nathan@kernel.org>,
	dvyukov@google.com, aliceryhl@google.com,
	samitolvanen@google.com, kasan-dev@googlegroups.com,
	linux-mm@kvack.org, glider@google.com, ryabinin.a.a@gmail.com,
	"Boqun Feng" <boqun.feng@gmail.com>,
	"Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <benno.lossin@proton.me>,
	"Andreas Hindborg" <a.hindborg@samsung.com>,
	"Nick Desaulniers" <ndesaulniers@google.com>,
	"Bill Wendling" <morbo@google.com>,
	"Justin Stitt" <justinstitt@google.com>,
	rust-for-linux@vger.kernel.org, llvm@lists.linux.dev
Subject: Re: [PATCH v4 0/4] Rust KASAN Support
Date: Mon, 16 Sep 2024 18:15:19 +0200	[thread overview]
Message-ID: <CANiq72mv5E0PvZRW5eAEvqvqj74PH01hcRhLWTouB4z32jTeSA@mail.gmail.com> (raw)
In-Reply-To: <20240820194910.187826-1-mmaurer@google.com>

On Tue, Aug 20, 2024 at 9:49 PM Matthew Maurer <mmaurer@google.com> wrote:
>
> Right now, if we turn on KASAN, Rust code will cause violations because
> it's not enabled properly.
>
> This series:
> 1. Adds flag probe macros for Rust - now that we're setting a minimum rustc
>    version instead of an exact one, these could be useful in general. We need
>    them in this patch because we don't set a restriction on which LLVM rustc
>    is using, which is what KASAN actually cares about.
> 2. Makes `rustc` enable the relevant KASAN sanitizer flags when C does.
> 3. Adds a smoke test to the `kasan_test` KUnit suite to check basic
>    integration.
>
> This patch series requires the target.json array support patch [1] as
> the x86_64 target.json file currently produced does not mark itself as KASAN
> capable, and is rebased on top of the KASAN Makefile rewrite [2].

Applied to `rust-next` -- thanks everyone!

    [ Applied empty line nit, removed double empty line,
      applied `rustfmt` and formatted crate comment. - Miguel ]

    [ Applied "SW_TAGS KASAN" nit. - Miguel ]

I think `TMPOUT` needs to be passed though, i.e. like I did in
https://github.com/Rust-for-Linux/linux/pull/1087#issuecomment-2218445303:

diff --git a/scripts/Makefile.compiler b/scripts/Makefile.compiler
index 057305eae85c..0ac8679095f4 100644
--- a/scripts/Makefile.compiler
+++ b/scripts/Makefile.compiler
@@ -20,6 +20,7 @@ TMPOUT = $(if $(KBUILD_EXTMOD),$(firstword
$(KBUILD_EXTMOD))/).tmp_$$$$
 # Exit code chooses option. "$$TMP" serves as a temporary file and is
 # automatically cleaned up.
 try-run = $(shell set -e;              \
+       TMPOUT=$(TMPOUT);               \
        TMP=$(TMPOUT)/tmp;              \
        trap "rm -rf $(TMPOUT)" EXIT;   \
        mkdir -p $(TMPOUT);             \

Or is there something I am missing?

Cheers,
Miguel

  parent reply	other threads:[~2024-09-16 16:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-20 19:48 [PATCH v4 0/4] Rust KASAN Support Matthew Maurer
2024-08-20 19:48 ` [PATCH v4 1/4] kbuild: rust: Define probing macros for rustc Matthew Maurer
2024-08-20 19:48 ` [PATCH v4 2/4] rust: kasan: Rust does not support KHWASAN Matthew Maurer
2024-08-20 19:48 ` [PATCH v4 3/4] kbuild: rust: Enable KASAN support Matthew Maurer
2024-08-20 19:57   ` Andrey Konovalov
2024-08-20 19:48 ` [PATCH v4 4/4] kasan: rust: Add KASAN smoke test via UAF Matthew Maurer
2024-08-20 19:57   ` Andrey Konovalov
2024-08-20 19:57 ` [PATCH v4 0/4] Rust KASAN Support Andrey Konovalov
2024-09-16 16:15 ` Miguel Ojeda [this message]
2024-09-16 16:46   ` Miguel Ojeda
2024-09-25  8:26     ` Alice Ryhl
2024-09-25 10:00       ` Alice Ryhl
2024-09-25 10:20         ` Miguel Ojeda

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=CANiq72mv5E0PvZRW5eAEvqvqj74PH01hcRhLWTouB4z32jTeSA@mail.gmail.com \
    --to=miguel.ojeda.sandonis@gmail.com \
    --cc=a.hindborg@samsung.com \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=andreyknvl@gmail.com \
    --cc=benno.lossin@proton.me \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=dvyukov@google.com \
    --cc=gary@garyguo.net \
    --cc=glider@google.com \
    --cc=justinstitt@google.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=linux-mm@kvack.org \
    --cc=llvm@lists.linux.dev \
    --cc=mmaurer@google.com \
    --cc=morbo@google.com \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=ryabinin.a.a@gmail.com \
    --cc=samitolvanen@google.com \
    --cc=wedsonaf@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).