[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250528174546.GC2023217@ZenIV>
Date: Wed, 28 May 2025 18:45:46 +0100
From: Al Viro <viro@...iv.linux.org.uk>
To: Alice Ryhl <aliceryhl@...gle.com>
Cc: Miguel Ojeda <ojeda@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Arnd Bergmann <arnd@...db.de>,
Andrew Morton <akpm@...ux-foundation.org>,
Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <benno.lossin@...ton.me>,
Andreas Hindborg <a.hindborg@...nel.org>,
Trevor Gross <tmgross@...ch.edu>,
Danilo Krummrich <dakr@...nel.org>, rust-for-linux@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] uaccess: rust: use newtype for user pointers
On Wed, May 28, 2025 at 10:47:12AM +0000, Alice Ryhl wrote:
> We don't currently have any way to perform that kind of pointer-math on
> user pointers, nor do we have any users of it. I imagine that this type
> checking is only useful if you can actually perform pointer math in the
> first place?
What you want is something like
x->field::UserPtr(beta) iff
x::UserPtr(alpha) and
_.field::beta where _::alpha
Generated code would be "add offset and cast to pointer to type of...",
but doing that manually would really invite headache.
Powered by blists - more mailing lists