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] [thread-next>] [day] [month] [year] [list]
Message-ID: <fa0534e5-a4e9-45e5-a202-e4647c99c514@proton.me>
Date: Sun, 18 Aug 2024 15:54:40 +0000
From: Benno Lossin <benno.lossin@...ton.me>
To: Greg KH <gregkh@...uxfoundation.org>, Andrew Lunn <andrew@...n.ch>
Cc: FUJITA Tomonori <fujita.tomonori@...il.com>, netdev@...r.kernel.org, rust-for-linux@...r.kernel.org, tmgross@...ch.edu, miguel.ojeda.sandonis@...il.com, aliceryhl@...gle.com
Subject: Re: [PATCH net-next v4 3/6] rust: net::phy implement AsRef<kernel::device::Device> trait

On 18.08.24 17:45, Greg KH wrote:
> On Sun, Aug 18, 2024 at 05:38:01PM +0200, Andrew Lunn wrote:
>>> Just to be sure: the `phydev.mdio.dev` struct is refcounted and
>>> incrementing the refcount is fine, right?
>>
>> There is nothing special here. PHY devices are just normal Linux
>> devices. The device core is responsible for calling .probe() and
>> .remove() on a device, and these should be the first and last
>> operation on a device. The device core provides refcounting of the
>> struct device, so it should always be valid.

Thanks that's good to know.

>> So i have to wounder if you are solving this at the correct
>> level. This should be generic to any device, so the Rust concept of a
>> device should be stating these guarantees, not each specific type of
>> device.
> 
> It should, why isn't it using the rust binding to Device that we already
> have:
> 	https://rust.docs.kernel.org/kernel/device/struct.Device.html
> or is it?  I'm confused now...

It is using that one.
I wanted to verify that we can use that one, since using this
implementation users can freely increment the refcount of the device
(without decrementing it before control is given back to PHYLIB). Since
that seems to be the case, all is fine.

---
Cheers,
Benno


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ