Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1359 CNY

100%

CVE-2024-53058— net: stmmac: TSO: Fix unbalanced DMA map/unmap for non-paged SKB data

Quick assessment

Affected
Linux Linux
Exploitation
No confirmed in-the-wild exploitation; assess based on exposure
Recommended action
Check the vendor advisory and references for a fixed version. If immediate upgrade is impossible, restrict exposure and increase monitoring.

Linux kernel是美国Linux基金会的开源操作系统Linux所使用的内核。 Linux kernel存在安全漏洞,该漏洞源于存在非页SKB数据的不平衡DMA映射或取消映射问题。

CVSS 9.4 · Critical EPSS 0.61% · P48

Possible ATT&CK Techniques 1 AI

T1564.008 · Email Hiding Rules

Affected Version Matrix 12

VendorProduct Version RangeStatus
Linux Linux f748be531d7012c456b97f66091d86b3675c5fef< ece593fc9c00741b682869d3f3dc584d37b7c9df affected
f748be531d7012c456b97f66091d86b3675c5fef< a3ff23f7c3f0e13f718900803e090fd3997d6bc9 affected
f748be531d7012c456b97f66091d86b3675c5fef< 07c9c26e37542486e34d767505e842f48f29c3f6 affected
f748be531d7012c456b97f66091d86b3675c5fef< 58d23d835eb498336716cca55b5714191a309286 affected
f748be531d7012c456b97f66091d86b3675c5fef< 66600fac7a984dea4ae095411f644770b2561ede affected
4.7 affected
< 4.7 unaffected
5.15.171≤ 5.15.* unaffected
… +4 more rows
Get alerts for future matching vulnerabilities Log in to subscribe

I. Basic Information for CVE-2024-53058

Vulnerability Information

Have questions about the vulnerability? See if Shenlong's analysis helps!
View Shenlong Deep Dive ↗

Although we use advanced large model technology, its output may still contain inaccurate or outdated information.Shenlong tries to ensure data accuracy, but please verify and judge based on the actual situation.

Vulnerability Title
net: stmmac: TSO: Fix unbalanced DMA map/unmap for non-paged SKB data
Source: CVE Program / CVE List V5
Vulnerability Description
In the Linux kernel, the following vulnerability has been resolved: net: stmmac: TSO: Fix unbalanced DMA map/unmap for non-paged SKB data In case the non-paged data of a SKB carries protocol header and protocol payload to be transmitted on a certain platform that the DMA AXI address width is configured to 40-bit/48-bit, or the size of the non-paged data is bigger than TSO_MAX_BUFF_SIZE on a certain platform that the DMA AXI address width is configured to 32-bit, then this SKB requires at least two DMA transmit descriptors to serve it. For example, three descriptors are allocated to split one DMA buffer mapped from one piece of non-paged data: dma_desc[N + 0], dma_desc[N + 1], dma_desc[N + 2]. Then three elements of tx_q->tx_skbuff_dma[] will be allocated to hold extra information to be reused in stmmac_tx_clean(): tx_q->tx_skbuff_dma[N + 0], tx_q->tx_skbuff_dma[N + 1], tx_q->tx_skbuff_dma[N + 2]. Now we focus on tx_q->tx_skbuff_dma[entry].buf, which is the DMA buffer address returned by DMA mapping call. stmmac_tx_clean() will try to unmap the DMA buffer _ONLY_IF_ tx_q->tx_skbuff_dma[entry].buf is a valid buffer address. The expected behavior that saves DMA buffer address of this non-paged data to tx_q->tx_skbuff_dma[entry].buf is: tx_q->tx_skbuff_dma[N + 0].buf = NULL; tx_q->tx_skbuff_dma[N + 1].buf = NULL; tx_q->tx_skbuff_dma[N + 2].buf = dma_map_single(); Unfortunately, the current code misbehaves like this: tx_q->tx_skbuff_dma[N + 0].buf = dma_map_single(); tx_q->tx_skbuff_dma[N + 1].buf = NULL; tx_q->tx_skbuff_dma[N + 2].buf = NULL; On the stmmac_tx_clean() side, when dma_desc[N + 0] is closed by the DMA engine, tx_q->tx_skbuff_dma[N + 0].buf is a valid buffer address obviously, then the DMA buffer will be unmapped immediately. There may be a rare case that the DMA engine does not finish the pending dma_desc[N + 1], dma_desc[N + 2] yet. Now things will go horribly wrong, DMA is going to access a unmapped/unreferenced memory region, corrupted data will be transmited or iommu fault will be triggered :( In contrast, the for-loop that maps SKB fragments behaves perfectly as expected, and that is how the driver should do for both non-paged data and paged frags actually. This patch corrects DMA map/unmap sequences by fixing the array index for tx_q->tx_skbuff_dma[entry].buf when assigning DMA buffer address. Tested and verified on DWXGMAC CORE 3.20a
Source: CVE Program / CVE List V5
CVSS Information
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:H
Source: CVE Program / CVE List V5
Vulnerability Type
N/A
Source: CVE Program / CVE List V5
Vulnerability Title
Linux kernel 安全漏洞
Source: CNNVD (China National Vulnerability Database)
Vulnerability Description
Linux kernel是美国Linux基金会的开源操作系统Linux所使用的内核。 Linux kernel存在安全漏洞,该漏洞源于存在非页SKB数据的不平衡DMA映射或取消映射问题。
Source: CNNVD (China National Vulnerability Database)
CVSS Information
N/A
Source: CNNVD (China National Vulnerability Database)
Vulnerability Type
N/A
Source: CNNVD (China National Vulnerability Database)

Affected Products

Vendor Product Affected Versions CPE Subscribe
Linux Linux f748be531d7012c456b97f66091d86b3675c5fef ~ ece593fc9c00741b682869d3f3dc584d37b7c9df -
Linux Linux 4.7 -

II. Public POCs for CVE-2024-53058

# POC Description Source Link Shenlong Link
AI-Generated POC Premium

No public POC found.

Login to generate AI POC

III. Intelligence Information for CVE-2024-53058

请登录查看更多情报信息。

Patches & Fixes for CVE-2024-53058 (1)

Same Patch Batch · Linux · 2024-11-19 · 88 CVEs total

CVE-2024-50283 9.8 CRITICAL ksmbd: fix slab-use-after-free in smb3_preauth_hash_rsp
CVE-2024-50286 9.8 CRITICAL ksmbd: fix slab-use-after-free in ksmbd_smb2_session_create
CVE-2024-50276 9.8 CRITICAL net: vertexcom: mse102x: Fix possible double free of TX skb
CVE-2024-53066 9.8 CRITICAL nfs: Fix KMSAN warning in decode_getfattr_attrs()
CVE-2024-53082 8.4 HIGH virtio_net: Add hash_key_length check
CVE-2024-50299 8.2 HIGH sctp: properly validate chunk size in sctp_sf_ootb()
CVE-2024-50291 7.8 HIGH media: dvb-core: add missing buffer index check
CVE-2024-50293 7.8 HIGH net/smc: do not leave a dangling sk pointer in __smc_create()
CVE-2024-50294 7.8 HIGH rxrpc: Fix missing locking causing hanging calls
CVE-2024-50288 7.8 HIGH media: vivid: fix buffer overwrite when using > 32 buffers
CVE-2024-50301 7.8 HIGH security/keys: fix slab-out-of-bounds in key_task_permission
CVE-2024-53063 7.8 HIGH media: dvbdev: prevent the risk of out of memory access
CVE-2024-53088 7.8 HIGH i40e: fix race condition by adding filter's intermediate sync state
CVE-2024-53080 7.8 HIGH drm/panthor: Lock XArray when getting entries for the VM
CVE-2024-53079 7.8 HIGH mm/thp: fix deferred split unqueue naming and locking
CVE-2024-53076 7.8 HIGH iio: gts-helper: Fix memory leaks for the error path of iio_gts_build_avail_scale_table()
CVE-2024-53044 7.8 HIGH net/sched: sch_api: fix xa_insert() error path in tcf_block_get_ext()
CVE-2024-50264 7.8 HIGH vsock/virtio: Initialization of the dangling pointer occurring in vsk->trans
CVE-2024-50300 7.8 HIGH regulator: rtq2208: Fix uninitialized use of regulator_config
CVE-2024-53057 7.8 HIGH net/sched: stop qdisc_tree_reduce_backlog on TC_H_ROOT

Showing top 20 of 88 CVEs. View all on vendor page &rarr; →

IV. Related Vulnerabilities

V. Comments for CVE-2024-53058

No comments yet


Leave a comment