<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/drivers/usb, branch v2023.01</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<entry>
<title>usb: gadget: rndis: Prevent InformationBufferOffset manipulation</title>
<updated>2022-12-08T13:30:39+00:00</updated>
<author>
<name>Szymon Heidrich</name>
<email>szymon.heidrich@gmail.com</email>
</author>
<published>2022-12-05T09:28:23+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=51a0e215ec8ce9cc88f928373e9ce8303db1829b'/>
<id>51a0e215ec8ce9cc88f928373e9ce8303db1829b</id>
<content type='text'>
Prevent access to arbitrary memory locations in gen_ndis_set_resp
via manipulation of buf-&gt;InformationBufferOffset. Original
implementation permits manipulation of InformationBufferOffset to
exploit OID_GEN_CURRENT_PACKET_FILTER to set arbitrary memory contents
within a 32byte offset as the devices packet filter. The packet filter
value may be next retrieved using gen_ndis_query_resp so it is possible
to extract specific memory regions two bytes a time.

The rndis_query_response was not modified as neither the buffer offset
nor length passed to gen_ndis_query_resp is used.

Signed-off-by: Szymon Heidrich &lt;szymon.heidrich@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Prevent access to arbitrary memory locations in gen_ndis_set_resp
via manipulation of buf-&gt;InformationBufferOffset. Original
implementation permits manipulation of InformationBufferOffset to
exploit OID_GEN_CURRENT_PACKET_FILTER to set arbitrary memory contents
within a 32byte offset as the devices packet filter. The packet filter
value may be next retrieved using gen_ndis_query_resp so it is possible
to extract specific memory regions two bytes a time.

The rndis_query_response was not modified as neither the buffer offset
nor length passed to gen_ndis_query_resp is used.

Signed-off-by: Szymon Heidrich &lt;szymon.heidrich@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: gadget: dfu: Fix check of transfer direction</title>
<updated>2022-12-08T13:30:39+00:00</updated>
<author>
<name>Hugo SIMELIERE</name>
<email>hsimeliere.opensource@witekio.com</email>
</author>
<published>2022-11-30T08:29:16+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=14dc0ab138988a8e45ffa086444ec8db48b3f103'/>
<id>14dc0ab138988a8e45ffa086444ec8db48b3f103</id>
<content type='text'>
Commit fbce985e28eaca3af82afecc11961aadaf971a7e to fix CVE-2022-2347
blocks DFU usb requests.
The verification of the transfer direction was done by an equality
but it is a bit mask.

Signed-off-by: Hugo SIMELIERE &lt;hsimeliere.opensource@witekio.com&gt;
Reviewed-by: Fabio Estevam &lt;festevam@denx.de&gt;
Reviewed-by: Sultan Qasim Khan &lt;sultan.qasimkhan@nccgroup.com&gt;
Reviewed-by: Marek Vasut &lt;marex@denx.de&gt;
Tested-by: Marek Vasut &lt;marex@denx.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit fbce985e28eaca3af82afecc11961aadaf971a7e to fix CVE-2022-2347
blocks DFU usb requests.
The verification of the transfer direction was done by an equality
but it is a bit mask.

Signed-off-by: Hugo SIMELIERE &lt;hsimeliere.opensource@witekio.com&gt;
Reviewed-by: Fabio Estevam &lt;festevam@denx.de&gt;
Reviewed-by: Sultan Qasim Khan &lt;sultan.qasimkhan@nccgroup.com&gt;
Reviewed-by: Marek Vasut &lt;marex@denx.de&gt;
Tested-by: Marek Vasut &lt;marex@denx.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: dwc3: Drop support for "snps, ref-clock-period-ns" DT property</title>
<updated>2022-11-27T14:34:56+00:00</updated>
<author>
<name>Marek Vasut</name>
<email>marex@denx.de</email>
</author>
<published>2022-11-27T14:31:56+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=db5bace4f6cb37251a5863efe4c0c1547d1334bd'/>
<id>db5bace4f6cb37251a5863efe4c0c1547d1334bd</id>
<content type='text'>
Drop support for quickly deprecated DT property "snps,ref-clock-period-ns"
to prevent its proliferation.

Reviewed-by: Sean Anderson &lt;seanga2@gmail.com&gt;
Signed-off-by: Marek Vasut &lt;marex@denx.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Drop support for quickly deprecated DT property "snps,ref-clock-period-ns"
to prevent its proliferation.

Reviewed-by: Sean Anderson &lt;seanga2@gmail.com&gt;
Signed-off-by: Marek Vasut &lt;marex@denx.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: dwc3: Program GFLADJ</title>
<updated>2022-11-27T14:34:56+00:00</updated>
<author>
<name>Sean Anderson</name>
<email>sean.anderson@seco.com</email>
</author>
<published>2022-11-27T14:31:55+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=c55ac51a550c8d2f8485abe94cb80c15b81d08fa'/>
<id>c55ac51a550c8d2f8485abe94cb80c15b81d08fa</id>
<content type='text'>
GUCTL.REFCLKPER can only account for clock frequencies with integer
periods. To address this, program REFCLK_FLADJ with the relative error
caused by period truncation. The formula given in the register reference
has been rearranged to allow calculation based on rate (instead of
period), and to allow for fixed-point arithmetic.

Additionally, calculate a value for 240MHZDECR. This configures a
simulated 240Mhz clock using a counter with one fractional bit (PLS1).

This register is programmed only for versions &gt;= 2.50a, since this is
the check also used by commit db2be4e9e30c ("usb: dwc3: Add frame length
adjustment quirk").

[ marek: Ported from Linux kernel commit
         596c87856e08d ("usb: dwc3: Program GFLADJ") ]

Reviewed-by: Sean Anderson &lt;seanga2@gmail.com&gt;
Signed-off-by: Sean Anderson &lt;sean.anderson@seco.com&gt;
Signed-off-by: Marek Vasut &lt;marex@denx.de&gt; # Port from Linux
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
GUCTL.REFCLKPER can only account for clock frequencies with integer
periods. To address this, program REFCLK_FLADJ with the relative error
caused by period truncation. The formula given in the register reference
has been rearranged to allow calculation based on rate (instead of
period), and to allow for fixed-point arithmetic.

Additionally, calculate a value for 240MHZDECR. This configures a
simulated 240Mhz clock using a counter with one fractional bit (PLS1).

This register is programmed only for versions &gt;= 2.50a, since this is
the check also used by commit db2be4e9e30c ("usb: dwc3: Add frame length
adjustment quirk").

[ marek: Ported from Linux kernel commit
         596c87856e08d ("usb: dwc3: Program GFLADJ") ]

Reviewed-by: Sean Anderson &lt;seanga2@gmail.com&gt;
Signed-off-by: Sean Anderson &lt;sean.anderson@seco.com&gt;
Signed-off-by: Marek Vasut &lt;marex@denx.de&gt; # Port from Linux
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: dwc3: Calculate REFCLKPER based on reference clock</title>
<updated>2022-11-27T14:34:56+00:00</updated>
<author>
<name>Sean Anderson</name>
<email>sean.anderson@seco.com</email>
</author>
<published>2022-11-27T14:31:54+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=6bae0eb5b8bd7f7f87c7bf106acea869da187b66'/>
<id>6bae0eb5b8bd7f7f87c7bf106acea869da187b66</id>
<content type='text'>
Instead of using a special property to determine the reference clock
period, use the rate of the reference clock. When we have a legacy
snps,ref-clock-period-ns property and no reference clock, use it
instead. Fractional clocks are not currently supported, and will be
dealt with in the next commit.

[ marek: Ported from Linux kernel commit
         5114c3ee24875 ("usb: dwc3: Calculate REFCLKPER based on reference clock") ]

Reviewed-by: Sean Anderson &lt;seanga2@gmail.com&gt;
Signed-off-by: Sean Anderson &lt;sean.anderson@seco.com&gt;
Signed-off-by: Marek Vasut &lt;marex@denx.de&gt; # Port from Linux
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Instead of using a special property to determine the reference clock
period, use the rate of the reference clock. When we have a legacy
snps,ref-clock-period-ns property and no reference clock, use it
instead. Fractional clocks are not currently supported, and will be
dealt with in the next commit.

[ marek: Ported from Linux kernel commit
         5114c3ee24875 ("usb: dwc3: Calculate REFCLKPER based on reference clock") ]

Reviewed-by: Sean Anderson &lt;seanga2@gmail.com&gt;
Signed-off-by: Sean Anderson &lt;sean.anderson@seco.com&gt;
Signed-off-by: Marek Vasut &lt;marex@denx.de&gt; # Port from Linux
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: dwc3: reference clock period configuration</title>
<updated>2022-11-27T14:34:56+00:00</updated>
<author>
<name>Balaji Prakash J</name>
<email>bjagadee@codeaurora.org</email>
</author>
<published>2022-11-27T14:31:53+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=57548e8bc7cb6eb1c1a0206579c2a84737a70650'/>
<id>57548e8bc7cb6eb1c1a0206579c2a84737a70650</id>
<content type='text'>
Set reference clock period when it differs from dwc3 default hardware
set.

We could calculate clock period based on reference clock frequency. But
this information is not always available. This is the case of PCI bus
attached USB host. For that reason we use a custom property.

Tested (USB2 only) on IPQ6010 SoC based board with 24 MHz reference
clock while hardware default is 19.2 MHz.

[ baruch: rewrite commit message; drop GFLADJ code; remove 'quirk-' from
  property name; mention tested hardware ]

[ marek: Ported from Linux kernel commit
         7bee318838890 ("usb: dwc3: reference clock period configuration") ]

Reviewed-by: Sean Anderson &lt;seanga2@gmail.com&gt;
Signed-off-by: Balaji Prakash J &lt;bjagadee@codeaurora.org&gt;
Signed-off-by: Baruch Siach &lt;baruch@tkos.co.il&gt;
Signed-off-by: Marek Vasut &lt;marex@denx.de&gt; # Port from Linux
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Set reference clock period when it differs from dwc3 default hardware
set.

We could calculate clock period based on reference clock frequency. But
this information is not always available. This is the case of PCI bus
attached USB host. For that reason we use a custom property.

Tested (USB2 only) on IPQ6010 SoC based board with 24 MHz reference
clock while hardware default is 19.2 MHz.

[ baruch: rewrite commit message; drop GFLADJ code; remove 'quirk-' from
  property name; mention tested hardware ]

[ marek: Ported from Linux kernel commit
         7bee318838890 ("usb: dwc3: reference clock period configuration") ]

Reviewed-by: Sean Anderson &lt;seanga2@gmail.com&gt;
Signed-off-by: Balaji Prakash J &lt;bjagadee@codeaurora.org&gt;
Signed-off-by: Baruch Siach &lt;baruch@tkos.co.il&gt;
Signed-off-by: Marek Vasut &lt;marex@denx.de&gt; # Port from Linux
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: dwc3: Cache ref_clk pointer in struct dwc3</title>
<updated>2022-11-27T14:34:56+00:00</updated>
<author>
<name>Marek Vasut</name>
<email>marex@denx.de</email>
</author>
<published>2022-11-27T14:31:52+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=8ae84e64530e81f23066d86417b9225388ba96ae'/>
<id>8ae84e64530e81f23066d86417b9225388ba96ae</id>
<content type='text'>
Cache ref_clk clock pointer in struct dwc3 . This is a preparatory
patch for subsequent backports from Linux kernel which configure
GFLADJ register content based on the ref_clk rate and therefore need
access to the ref_clk pointer.

It is possible to extract the clock pointer from existing clk_bulk
list of already claimed clock, no need to call clk_get*() again.

Reviewed-by: Sean Anderson &lt;seanga2@gmail.com&gt;
Signed-off-by: Marek Vasut &lt;marex@denx.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Cache ref_clk clock pointer in struct dwc3 . This is a preparatory
patch for subsequent backports from Linux kernel which configure
GFLADJ register content based on the ref_clk rate and therefore need
access to the ref_clk pointer.

It is possible to extract the clock pointer from existing clk_bulk
list of already claimed clock, no need to call clk_get*() again.

Reviewed-by: Sean Anderson &lt;seanga2@gmail.com&gt;
Signed-off-by: Marek Vasut &lt;marex@denx.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: Expand buffer size in usb_find_and_bind_driver()</title>
<updated>2022-11-27T11:04:36+00:00</updated>
<author>
<name>Marek Vasut</name>
<email>marex@denx.de</email>
</author>
<published>2022-11-26T12:57:53+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=55a95f8f58cf5c884edfe8714bf681cd17ef7242'/>
<id>55a95f8f58cf5c884edfe8714bf681cd17ef7242</id>
<content type='text'>
The "generic_bus_%x_dev_%x" string which is printed into this buffer
can be up to 34 characters long ("generic_bus_12345678_dev_12345678").
The buffer would be clipped by snprintf() if both %x were at maximum
range. Make sure the buffer is long enough to cover such possibility.

Signed-off-by: Marek Vasut &lt;marex@denx.de&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The "generic_bus_%x_dev_%x" string which is printed into this buffer
can be up to 34 characters long ("generic_bus_12345678_dev_12345678").
The buffer would be clipped by snprintf() if both %x were at maximum
range. Make sure the buffer is long enough to cover such possibility.

Signed-off-by: Marek Vasut &lt;marex@denx.de&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>sandbox: check lseek return value in handle_ufi_command</title>
<updated>2022-11-22T22:13:35+00:00</updated>
<author>
<name>Heinrich Schuchardt</name>
<email>heinrich.schuchardt@canonical.com</email>
</author>
<published>2022-11-10T07:40:30+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=b3a680a47abfdd5fa4086bab53891f3a4e798d74'/>
<id>b3a680a47abfdd5fa4086bab53891f3a4e798d74</id>
<content type='text'>
Invoking lseek() may result in an error. Handle it.

Addresses-Coverity-ID: 376212 ("Error handling issues  (CHECKED_RETURN)")
Signed-off-by: Heinrich Schuchardt &lt;heinrich.schuchardt@canonical.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Invoking lseek() may result in an error. Handle it.

Addresses-Coverity-ID: 376212 ("Error handling issues  (CHECKED_RETURN)")
Signed-off-by: Heinrich Schuchardt &lt;heinrich.schuchardt@canonical.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: gadget: dfu: Fix the unchecked length field</title>
<updated>2022-11-21T14:23:00+00:00</updated>
<author>
<name>Venkatesh Yadav Abbarapu</name>
<email>venkatesh.abbarapu@amd.com</email>
</author>
<published>2022-11-03T04:07:48+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=fbce985e28eaca3af82afecc11961aadaf971a7e'/>
<id>fbce985e28eaca3af82afecc11961aadaf971a7e</id>
<content type='text'>
DFU implementation does not bound the length field in USB
DFU download setup packets, and it does not verify that
the transfer direction. Fixing the length and transfer
direction.

CVE-2022-2347

Signed-off-by: Venkatesh Yadav Abbarapu &lt;venkatesh.abbarapu@amd.com&gt;
Reviewed-by: Marek Vasut &lt;marex@denx.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
DFU implementation does not bound the length field in USB
DFU download setup packets, and it does not verify that
the transfer direction. Fixing the length and transfer
direction.

CVE-2022-2347

Signed-off-by: Venkatesh Yadav Abbarapu &lt;venkatesh.abbarapu@amd.com&gt;
Reviewed-by: Marek Vasut &lt;marex@denx.de&gt;
</pre>
</div>
</content>
</entry>
</feed>
