lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87seo6coe6.fsf@kernel.org>
Date: Sat, 22 Feb 2025 10:36:01 +0100
From: Andreas Hindborg <a.hindborg@...nel.org>
To: "Daniel Almeida" <daniel.almeida@...labora.com>
Cc: "Miguel Ojeda" <ojeda@...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>,  "Benno
 Lossin" <benno.lossin@...ton.me>,  "Alice Ryhl" <aliceryhl@...gle.com>,
  "Trevor Gross" <tmgross@...ch.edu>,  "Peter Zijlstra"
 <peterz@...radead.org>,  "Ingo Molnar" <mingo@...hat.com>,  "Will Deacon"
 <will@...nel.org>,  "Waiman Long" <longman@...hat.com>,  "Danilo
 Krummrich" <dakr@...nel.org>,  "Joel Becker" <jlbec@...lplan.org>,
  "Christoph Hellwig" <hch@....de>,  "Fiona Behrens" <me@...enk.dev>,
  "Charalampos Mitrodimas" <charmitro@...teo.net>,
  <rust-for-linux@...r.kernel.org>,  <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 0/4] rust: configfs abstractions

"Daniel Almeida" <daniel.almeida@...labora.com> writes:

> Hi Andreas,
>
>> On 18 Feb 2025, at 09:57, Andreas Hindborg <a.hindborg@...nel.org> wrote:
>>
>> This series adds a safe Rust API that allows Rust modules to interface
>> the `configfs` machinery.
>>
>> The series contains an example for the samples folder to demonstrate
>> usage of the API. As such, there is no inline example in the
>> documentation.
>>
>> The last patch adds a maintainer entry for the Rust configfs
>> abstractions, to make it absolutely clear that I will commit to maintain
>> these abstractions, if required. Feel free to drop this patch if this is
>> not required.
>>
>> The series is a dependency of `rnull`, the Rust null block driver.
>> Please see [1] for initial `configfs` support in `rnull`.
>>
>> [1] https://github.com/metaspace/linux/tree/9ac53130f5fb05b9b3074fa261b445b8fde547dd/drivers/block/rnull
>>
>
> I am trying to test this before reviewing, but I get this error:
>
>
> ```
> error[E0308]: mismatched types
>    --> linux/rust/kernel/miscdevice.rs:300:62
>     |
> 300 |     let device = unsafe { <T::Ptr as ForeignOwnable>::borrow(private) };
>     |                           ---------------------------------- ^^^^^^^ expected `*mut <... as ForeignOwnable>::PointedTo`, found `*mut c_void`
>     |                           |
>     |                           arguments to this function are incorrect
>     |
>     = note: expected raw pointer `*mut <<T as miscdevice::MiscDevice>::Ptr as types::ForeignOwnable>::PointedTo`
>                found raw pointer `*mut ffi::c_void`
>     = help: consider constraining the associated type `<<T as miscdevice::MiscDevice>::Ptr as types::ForeignOwnable>::PointedTo` to `ffi::c_void` or calling a method that returns `<<T as miscdevice::MiscDevice>::Ptr as types::ForeignOwnable>::PointedTo`
>     = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
> note: associated function defined here
>    --> /home/dwls/dev/linux/rust/kernel/types.rs:98:15
>     |
> 98  |     unsafe fn borrow<'a>(ptr: *mut Self::PointedTo) -> Self::Borrowed<'a>;
>     |               ^^^^^^
>
> error: aborting due to 1 previous error
> ```

Thanks for testing! It seems there is a bug in the patch "rust: sync:
change `<Arc<T> as ForeignOwnable>::PointedTo` to `T`". If you would
like to test now, could you either:

- add `.cast()` on `private` in miscdevice.rs:300
- or drop patch 1/4 and pick [1] as a dependency instead
- or build with `CONFIG_COMPAT=n`

Or wait for me to send a new version where I add a dependency on the
fixed patch.


Best regards,
Andreas Hindborg



[1] https://lore.kernel.org/all/20250218-rust-xarray-bindings-v17-0-f3a99196e538@gmail.com/


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ