[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <DAGJB089ANQI.X0EM66P0KMWF@kernel.org>
Date: Sat, 07 Jun 2025 21:05:57 +0200
From: "Benno Lossin" <lossin@...nel.org>
To: "Christian Schrefl" <chrisi.schrefl@...il.com>, "Miguel Ojeda"
<ojeda@...nel.org>, "Danilo Krummrich" <dakr@...nel.org>, "Alex Gaynor"
<alex.gaynor@...il.com>, "Boqun Feng" <boqun.feng@...il.com>, "Gary Guo"
<gary@...yguo.net>, Björn Roy Baron
<bjorn3_gh@...tonmail.com>, "Andreas Hindborg" <a.hindborg@...nel.org>,
"Alice Ryhl" <aliceryhl@...gle.com>, "Trevor Gross" <tmgross@...ch.edu>,
"Arnd Bergmann" <arnd@...db.de>, "Greg Kroah-Hartman"
<gregkh@...uxfoundation.org>, "Lee Jones" <lee@...nel.org>, "Daniel
Almeida" <daniel.almeida@...labora.com>
Cc: Gerald Wisböck <gerald.wisboeck@...ther.ink>,
<rust-for-linux@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v4 2/3] rust: miscdevice: add additional data to
MiscDeviceRegistration
On Sat Jun 7, 2025 at 5:39 PM CEST, Christian Schrefl wrote:
> On 07.06.25 5:37 PM, Benno Lossin wrote:
>> On Sat Jun 7, 2025 at 1:34 PM CEST, Christian Schrefl wrote:
>>> Yeah I understand that its not UB, but to me it seems a bit fragile and opaque why it is allowed.
>>> That's what I meant by "a bit iffy".
>>
>> What's fragile about it? That someone could add a non-opaque field to
>> the struct? Or that one is not allowed to take an `&`?
>
> Yeah that a added field could cause UB seems bad to me.
Actually, I don't think it would be UB, since only the `data` field
would be borrowed mutably/immutably at the same time, but not the new
field.
---
Cheers,
Benno
Powered by blists - more mailing lists