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: <e87a80d9-9603-4d27-99a7-a34eeda8c6f5@linux.intel.com>
Date: Mon, 19 May 2025 16:14:33 +0300
From: Mathias Nyman <mathias.nyman@...ux.intel.com>
To: Jay Chen <shawn2000100@...il.com>, mathias.nyman@...el.com,
 gregkh@...uxfoundation.org
Cc: linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
 jay.chen@...mens.com
Subject: Re: [PATCH v3] usb: xhci: Set avg_trb_len = 8 for EP0 during Address
 Device Command

On 16.5.2025 6.39, Jay Chen wrote:
> According to the xHCI 1.2 spec (Section 6.2.3, p.454), the Average
> TRB Length (avg_trb_len) for control endpoints should be set to 8.

Maybe add here "But section 4.8.2 "Endpoint Context Initialization"
states that all fields of an Input Endpoint Context data structure
(including the Reserved fields) shall be initialized to 0
> > Currently, during the Address Device Command, EP0's avg_trb_len remains 0,
> which may cause some xHCI hardware to reject the Input Context, resulting
> in device enumeration failures. In extreme cases, using a zero avg_trb_len
> in calculations may lead to division-by-zero errors and unexpected system
> crashes.

Would be good to specify here which exact hardware requires avg_trb_len to be
set before the 'Address Device Command'. This way we can later create a
quirk for it in case it turns out other existing controllers can't handle it.

So far it seems other hosts can handle it well, and quirks may not be needed
at all. Thanks to MichaƂ for testing.

Thanks
Mathias

> 
> This patch sets avg_trb_len to 8 for EP0 in
> xhci_setup_addressable_virt_dev(), ensuring compliance with the spec
> and improving compatibility across various host controller implementations.

I'd skip the 'compliance with spec..' part as spec is a bit unclear on this
issue.

Thanks
Mathias


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ