[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250221181154.GB2128534@mit.edu>
Date: Fri, 21 Feb 2025 13:11:54 -0500
From: "Theodore Ts'o" <tytso@....edu>
To: Dan Carpenter <dan.carpenter@...aro.org>
Cc: Martin Uecker <uecker@...raz.at>, Greg KH <gregkh@...uxfoundation.org>,
Boqun Feng <boqun.feng@...il.com>, "H. Peter Anvin" <hpa@...or.com>,
Miguel Ojeda <miguel.ojeda.sandonis@...il.com>,
Christoph Hellwig <hch@...radead.org>,
rust-for-linux <rust-for-linux@...r.kernel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
David Airlie <airlied@...il.com>, linux-kernel@...r.kernel.org,
ksummit@...ts.linux.dev
Subject: Re: Rust kernel policy
On Fri, Feb 21, 2025 at 12:48:11PM +0300, Dan Carpenter wrote:
> On Thu, Feb 20, 2025 at 04:40:02PM +0100, Martin Uecker wrote:
> > I mean "memory safe" in the sense that you can not have an OOB access
> > or use-after-free or any other UB. The idea would be to mark certain
> > code regions as safe, e.g.
> >
> > #pragma MEMORY_SAFETY STATIC
>
> Could we tie this type of thing to a scope instead? Maybe there
> would be a compiler parameter to default on/off and then functions
> and scopes could be on/off if we need more fine control.
>
> This kind of #pragma is basically banned in the kernel. It's used
> in drivers/gpu/drm but it disables the Sparse static checker.
I'm not sure what you mean by "This kind of #pragma"? There are quite
a lot of pragma's in the kernel sources today; surely it's only a
specific #pragma directive that disables sparse?
Not a global, general rule: if sparse sees a #pragma, it exits, stage left?
- Ted
Powered by blists - more mailing lists