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: <1f8f3630-e96a-4929-b95f-46002c8d0143@linux.intel.com>
Date: Thu, 9 Jan 2025 12:04:58 +0200
From: Mathias Nyman <mathias.nyman@...ux.intel.com>
To: WangYuli <wangyuli@...ontech.com>, mathias.nyman@...el.com,
 gregkh@...uxfoundation.org
Cc: linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
 niklas.neronin@...ux.intel.com, quic_wcheng@...cinc.com,
 andriy.shevchenko@...ux.intel.com, michal.pecio@...il.com,
 guanwentao@...ontech.com, zhanjun@...ontech.com, bigeasy@...utronix.de,
 balbi@...com, hkallweit1@...il.com, Xu Rao <raoxu@...ontech.com>
Subject: Re: [PATCH v2] usb: host: xhci-plat: Assign shared_hcd->rsrc_start

On 4.1.2025 17.51, WangYuli wrote:
> When inserting a USB device, examining hcd->rsrc_start can be
> helpful in identifying which hcd is mounted, as the physical
> address represented here is typically unique.
> 
> The following code snippet demonstrates this:
>    struct usb_hcd *hcd = bus_to_hcd(udev->bus);
>    unsigned long long usb_hcd_addr = (unsigned long long)hcd->rsrc_start;
> 
> However, this approach has limitations now. For USB hosts with an
> MMIO interface, the effectiveness of this method is restricted to
> USB 2.0.
> 
> Becase commit 3429e91a661e ("usb: host: xhci: add platform driver
> support") assigned res->start to hcd->rsrc_start. But
> shared_hcd->rsrc_start remains unassigned, which is also necessary
> in certain scenarios.

Could you expand on those scenarios?

Is it possible those could be solved with something like:

unsigned long long usb_hcd_addr;
struct usb_hcd *hcd = bus_to_hcd(udev->bus);

if (!usb_hcd_is_primary_hcd(hcd))
	hcd = hcd->primary_hcd;
usb_hcd_addr = (unsigned long long)hcd->rsrc_start;

That should work for all hcds.

Thanks
Mathias


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ