[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <04d1cf43-9efe-4597-a6a9-8f2b801ec049@ralfj.de>
Date: Wed, 26 Feb 2025 15:01:36 +0100
From: Ralf Jung <post@...fj.de>
To: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>,
Kent Overstreet <kent.overstreet@...ux.dev>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Alice Ryhl <aliceryhl@...gle.com>, Ventura Jack <venturajack85@...il.com>,
Gary Guo <gary@...yguo.net>, airlied@...il.com, boqun.feng@...il.com,
david.laight.linux@...il.com, ej@...i.de, gregkh@...uxfoundation.org,
hch@...radead.org, hpa@...or.com, ksummit@...ts.linux.dev,
linux-kernel@...r.kernel.org, rust-for-linux@...r.kernel.org
Subject: Re: C aggregate passing (Rust kernel policy)
Hi all,
>> I think the one thing that's missing w.r.t. aliasing that Rust could
>> maybe use is a kasan-style sanitizer, I think with treeborrows and "now
>> we have an actual model for aliasing optimizations" it should be possible
>> to write such a sanitizer. But the amount of code doing complicated
>> enough stuff with unsafe should really be quite small, so - shouldn't be
>
> Miri implements those models and can check code for conformance. It
> can be used easily in the Rust playground (top-right corner -> Tools
> -> Miri):
>
> https://play.rust-lang.org
>
> However, it does not work when you involved C FFI, though, but you can
> play there. For more advanced usage, e.g. testing a particular model
> like Tree Borrows, I think you need to use it locally, since I am not
> sure if flags can be passed yet.
>
> I would like to get it, plus other tools, into Compiler Explorer, see
> e.g. https://github.com/compiler-explorer/compiler-explorer/issues/2563.
By default (and on the playground), Miri will check Stacked Borrows rules. Those
are almost always *more strict* than Tree Borrows rules.
Unfortunately playground does not let you pass your own flags, so yeah getting
Miri on godbolt would be great. :D
Kind regards,
Ralf
Powered by blists - more mailing lists