Linux kbuild/kconfig development
 help / color / mirror / Atom feed
From: Conor Dooley <conor@kernel.org>
To: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Cc: "Alice Ryhl" <aliceryhl@google.com>,
	"Paul Walmsley" <paul.walmsley@sifive.com>,
	"Palmer Dabbelt" <palmer@dabbelt.com>,
	"Albert Ou" <aou@eecs.berkeley.edu>,
	"Catalin Marinas" <catalin.marinas@arm.com>,
	"Will Deacon" <will@kernel.org>,
	"Ard Biesheuvel" <ardb@kernel.org>,
	"Jamie Cunliffe" <Jamie.Cunliffe@arm.com>,
	"Sami Tolvanen" <samitolvanen@google.com>,
	"Nathan Chancellor" <nathan@kernel.org>,
	"Kees Cook" <kees@kernel.org>,
	"Masahiro Yamada" <masahiroy@kernel.org>,
	"Nicolas Schier" <nicolas@fjasle.eu>,
	"Marc Zyngier" <maz@kernel.org>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Mark Brown" <broonie@kernel.org>,
	"Nick Desaulniers" <ndesaulniers@google.com>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	"Alex Gaynor" <alex.gaynor@gmail.com>,
	"Wedson Almeida Filho" <wedsonaf@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>,
	"Valentin Obst" <kernel@valentinobst.de>,
	linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	rust-for-linux@vger.kernel.org,
	linux-riscv <linux-riscv@lists.infradead.org>
Subject: Re: [PATCH v7] rust: support for shadow call stack sanitizer
Date: Fri, 13 Sep 2024 22:17:56 +0100	[thread overview]
Message-ID: <20240913-shack-estate-b376a65921b1@spud> (raw)
In-Reply-To: <CANiq72kNmvFOXhhAcQJQdMC872908=CWW15_bzyyt9ht2q=twQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3034 bytes --]

On Fri, Sep 13, 2024 at 12:08:20AM +0200, Miguel Ojeda wrote:
> On Thu, Aug 29, 2024 at 10:23 AM Alice Ryhl <aliceryhl@google.com> wrote:
> >
> > Add all of the flags that are needed to support the shadow call stack
> > (SCS) sanitizer with Rust, and updates Kconfig to allow only
> > configurations that work.
> 
> Applied to `rust-next` -- thanks everyone!
> 
> Paul/Palmer/Albert/RISC-V: I think you were not Cc'd (at least in this
> version?), so please shout if you have a problem with this.

For some reason I deleted the series from my mailbox, must've been in
dt-binding review mode and hit ctrl + d. I've been away and busy, so my
apologies Alice for not trying this out sooner.
It's sorta annoying to test rust + scs on riscv, cos you need (unless I
am mistaken) llvm-19. llvm-18 + rust built fine, but has no SCS.

llvm-19 + rust failed to build for me riscv, producing:

In file included from /stuff/linux/rust/helpers/helpers.c:22:
/stuff/linux/rust/helpers/spinlock.c:10:23: error: call to undeclared function 'spinlock_check'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
__raw_spin_lock_init(spinlock_check(lock), name, key, LD_WAIT_CONFIG);
^
/stuff/linux/rust/helpers/spinlock.c:10:23: error: incompatible integer to pointer conversion passing 'int' to parameter of type 'raw_spinlock_t *' (aka 'struct raw_spinlock *') [-Wint-conversion]
__raw_spin_lock_init(spinlock_check(lock), name, key, LD_WAIT_CONFIG);
^~~~~~~~~~~~~~~~~~~~
/stuff/linux/include/linux/spinlock.h:101:52: note: passing argument to parameter 'lock' here
extern void __raw_spin_lock_init(raw_spinlock_t *lock, const char *name,
^
2 errors generated.

This occurs because I have DEBUG_SPINLOCK enabled. I didn't check why,
but Andreas seems to have introduced that code - luckily he's already on
CC here :)

With that disabled, there are dozens of warnings along the lines of:
/stuff/linux/rust/helpers/err.c:6:14: warning: symbol 'rust_helper_ERR_PTR' was not declared. Should it be static?
If those are okay for rust code, it would be rather helpful if the
warnings could be disabled - otherwise they should really be fixed.

Following that, I got a build error:

error[E0425]: cannot find function `__mutex_init` in crate `bindings`
--> /stuff/linux/rust/kernel/sync/lock/mutex.rs:104:28
|
104   |           unsafe { bindings::__mutex_init(ptr, name, key) }
|                              ^^^^^^^^^^^^ help: a function with a similar name exists: `__mutex_rt_init`
|
::: /stuff/brsdk/work/linux/rust/bindings/bindings_generated.rs:12907:5
|
12907 | /     pub fn __mutex_rt_init(
12908 | |         lock: *mut mutex,
12909 | |         name: *const core::ffi::c_char,
12910 | |         key: *mut lock_class_key,
12911 | |     );
| |_____- similarly named function `__mutex_rt_init` defined here

error: aborting due to 1 previous error

I stopped there, Space Marine 2 awaits.

Hopefully I'll get to say hello next week,
Conor.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2024-09-13 21:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-29  8:22 [PATCH v7] rust: support for shadow call stack sanitizer Alice Ryhl
2024-09-12 22:08 ` Miguel Ojeda
2024-09-13 21:17   ` Conor Dooley [this message]
2024-09-13 21:44     ` Alice Ryhl
2024-09-13 21:47       ` Conor Dooley
2024-09-15  7:32       ` Dirk Behme
2024-09-15 11:36         ` Gary Guo
2024-09-14 16:30     ` Gary Guo
2024-09-14 16:46       ` Conor Dooley
2024-09-14 22:15         ` Conor Dooley
2024-09-15 19:15           ` 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=20240913-shack-estate-b376a65921b1@spud \
    --to=conor@kernel.org \
    --cc=Jamie.Cunliffe@arm.com \
    --cc=a.hindborg@samsung.com \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=ardb@kernel.org \
    --cc=benno.lossin@proton.me \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=broonie@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=gary@garyguo.net \
    --cc=kees@kernel.org \
    --cc=kernel@valentinobst.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=masahiroy@kernel.org \
    --cc=maz@kernel.org \
    --cc=miguel.ojeda.sandonis@gmail.com \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=nicolas@fjasle.eu \
    --cc=ojeda@kernel.org \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=samitolvanen@google.com \
    --cc=wedsonaf@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox