<?xml version='1.0' encoding='UTF-8'?>
<?xml-stylesheet href="/static/style.xsl" type="text/xsl"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0">
  <channel>
    <title>Most recent entries from all</title>
    <link>https://cve.radiocsirt.org</link>
    <description>Contains only the most 10 recent entries.</description>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <generator>python-feedgen</generator>
    <language>en</language>
    <lastBuildDate>Wed, 21 Oct 2026 12:11:05 +0000</lastBuildDate>
    <item>
      <title>CVE-2021-46986 — usb: dwc3: gadget: Free gadget structure only after freeing endpoints</title>
      <link>https://cve.radiocsirt.org/vuln/cve-2021-46986</link>
      <description>&lt;p&gt;&lt;strong&gt;Affected:&lt;/strong&gt; Linux&lt;/p&gt;
&lt;p&gt;In the Linux kernel, the following vulnerability has been resolved:&lt;/p&gt;
&lt;p&gt;usb: dwc3: gadget: Free gadget structure only after freeing endpoints&lt;/p&gt;
&lt;p&gt;As part of commit e81a7018d93a (&amp;#34;usb: dwc3: allocate gadget structure
dynamically&amp;#34;) the dwc3_gadget_release() was added which will free
the dwc-&amp;gt;gadget structure upon the device&amp;#39;s removal when
usb_del_gadget_udc() is called in dwc3_gadget_exit().&lt;/p&gt;
&lt;p&gt;However, simply freeing the gadget results a dangling pointer
situation: the endpoints created in dwc3_gadget_init_endpoints()
have their dep-&amp;gt;endpoint.ep_list members chained off the list_head
anchored at dwc-&amp;gt;gadget-&amp;gt;ep_list.  Thus when dwc-&amp;gt;gadget is freed,
the first dwc3_ep in the list now has a dangling prev pointer and
likewise for the next pointer of the dwc3_ep at the tail of the list.
The dwc3_gadget_free_endpoints() that follows will result in a
use-after-free when it calls list_del().&lt;/p&gt;
&lt;p&gt;This was caught by enabling KASAN and performing a driver unbind.
The recent commit 568262bf5492 (&amp;#34;usb: dwc3: core: Add shutdown
callback for dwc3&amp;#34;) also exposes this as a panic during shutdown.&lt;/p&gt;
&lt;p&gt;There are a few possibilities to fix this.  One could be to perform
a list_del() of the gadget-&amp;gt;ep_list itself which removes it from
the rest of the dwc3_ep chain.&lt;/p&gt;
&lt;p&gt;Another approach is what this patch does, by splitting up the
usb_del_gadget_udc() call into its separate &amp;#34;del&amp;#34; and &amp;#34;put&amp;#34;
components.  This allows dwc3_gadget_free_endpoints() to be
called before the gadget is finally freed with usb_put_gadget().&lt;/p&gt;</description>
      <content:encoded>&lt;p&gt;&lt;strong&gt;Affected:&lt;/strong&gt; Linux&lt;/p&gt;
&lt;p&gt;In the Linux kernel, the following vulnerability has been resolved:&lt;/p&gt;
&lt;p&gt;usb: dwc3: gadget: Free gadget structure only after freeing endpoints&lt;/p&gt;
&lt;p&gt;As part of commit e81a7018d93a (&amp;#34;usb: dwc3: allocate gadget structure
dynamically&amp;#34;) the dwc3_gadget_release() was added which will free
the dwc-&amp;gt;gadget structure upon the device&amp;#39;s removal when
usb_del_gadget_udc() is called in dwc3_gadget_exit().&lt;/p&gt;
&lt;p&gt;However, simply freeing the gadget results a dangling pointer
situation: the endpoints created in dwc3_gadget_init_endpoints()
have their dep-&amp;gt;endpoint.ep_list members chained off the list_head
anchored at dwc-&amp;gt;gadget-&amp;gt;ep_list.  Thus when dwc-&amp;gt;gadget is freed,
the first dwc3_ep in the list now has a dangling prev pointer and
likewise for the next pointer of the dwc3_ep at the tail of the list.
The dwc3_gadget_free_endpoints() that follows will result in a
use-after-free when it calls list_del().&lt;/p&gt;
&lt;p&gt;This was caught by enabling KASAN and performing a driver unbind.
The recent commit 568262bf5492 (&amp;#34;usb: dwc3: core: Add shutdown
callback for dwc3&amp;#34;) also exposes this as a panic during shutdown.&lt;/p&gt;
&lt;p&gt;There are a few possibilities to fix this.  One could be to perform
a list_del() of the gadget-&amp;gt;ep_list itself which removes it from
the rest of the dwc3_ep chain.&lt;/p&gt;
&lt;p&gt;Another approach is what this patch does, by splitting up the
usb_del_gadget_udc() call into its separate &amp;#34;del&amp;#34; and &amp;#34;put&amp;#34;
components.  This allows dwc3_gadget_free_endpoints() to be
called before the gadget is finally freed with usb_put_gadget().&lt;/p&gt;</content:encoded>
      <guid isPermaLink="false">https://cve.radiocsirt.org/vuln/cve-2021-46986</guid>
    </item>
  </channel>
</rss>
