CVE-2024-26748

Source
https://nvd.nist.gov/vuln/detail/CVE-2024-26748
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2024-26748.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2024-26748
Downstream
Related
Published
2024-04-03T17:00:35.087Z
Modified
2025-11-28T02:35:03.372357Z
Summary
usb: cdns3: fix memory double free when handle zero packet
Details

In the Linux kernel, the following vulnerability has been resolved:

usb: cdns3: fix memory double free when handle zero packet

829 if (request->complete) { 830 spinunlock(&privdev->lock); 831 usbgadgetgivebackrequest(&privep->endpoint, 832 request); 833 spinlock(&privdev->lock); 834 } 835 836 if (request->buf == privdev->zlpbuf) 837 cdns3gadgetepfreerequest(&priv_ep->endpoint, request);

Driver append an additional zero packet request when queue a packet, which length mod max packet size is 0. When transfer complete, run to line 831, usbgadgetgivebackrequest() will free this requestion. 836 condition is true, so cdns3gadgetepfree_request() free this request again.

Log:

[ 1920.140696][ T150] BUG: KFENCE: use-after-free read in cdns3gadgetgiveback+0x134/0x2c0 [cdns3] [ 1920.140696][ T150] [ 1920.151837][ T150] Use-after-free read at 0x000000003d1cd10b (in kfence-#36): [ 1920.159082][ T150] cdns3gadgetgiveback+0x134/0x2c0 [cdns3] [ 1920.164988][ T150] cdns3transfercompleted+0x438/0x5f8 [cdns3]

Add check at line 829, skip call usbgadgetgivebackrequest() if it is additional zero length packet request. Needn't call usbgadgetgivebackrequest() because it is allocated in this driver.

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/26xxx/CVE-2024-26748.json"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
7733f6c32e36ff9d7adadf40001039bf219b1cbe
Fixed
aad6132ae6e4809e375431f8defd1521985e44e7
Fixed
1e204a8e9eb514e22a6567fb340ebb47df3f3a48
Fixed
3a2a909942b5335b7ea66366d84261b3ed5f89c8
Fixed
9a52b694b066f299d8b9800854a8503457a8b64c
Fixed
70e8038813f9d3e72df966748ebbc40efe466019
Fixed
92d20406a3d4ff3e8be667c79209dc9ed31df5b3
Fixed
5fd9e45f1ebcd57181358af28506e8a661a260b3

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
5.4.0
Fixed
5.4.270
Type
ECOSYSTEM
Events
Introduced
5.5.0
Fixed
5.10.211
Type
ECOSYSTEM
Events
Introduced
5.11.0
Fixed
5.15.150
Type
ECOSYSTEM
Events
Introduced
5.16.0
Fixed
6.1.80
Type
ECOSYSTEM
Events
Introduced
6.2.0
Fixed
6.6.19
Type
ECOSYSTEM
Events
Introduced
6.7.0
Fixed
6.7.7