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

Goal: 1000 CNY · Raised: 1359 CNY

100%

CVE-2023-54180— btrfs: handle case when repair happens with dev-replace

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存在安全漏洞,该漏洞源于btrfs在设备替换期间处理修复不当,可能导致空指针取消引用。

AI Predicted 5.5 Difficulty: Moderate EPSS 0.20% · P9

Affected Version Matrix 8

VendorProduct Version RangeStatus
Linux Linux ad6d620e2a5704f6bf3a39c92a75aad962c51cb3< a7018b40b49c37fb55736499f790ec0d2b381ae4 affected
ad6d620e2a5704f6bf3a39c92a75aad962c51cb3< 53e9d6851b56626885476a2966194ba994f8bb4b affected
ad6d620e2a5704f6bf3a39c92a75aad962c51cb3< d73a27b86fc722c28a26ec64002e3a7dc86d1c07 affected
3.8 affected
< 3.8 unaffected
6.0.19≤ 6.0.* unaffected
6.1.5≤ 6.1.* unaffected
6.2≤ * unaffected
Get alerts for future matching vulnerabilities Log in to subscribe

I. Basic Information for CVE-2023-54180

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
btrfs: handle case when repair happens with dev-replace
Source: CVE Program / CVE List V5
Vulnerability Description
In the Linux kernel, the following vulnerability has been resolved: btrfs: handle case when repair happens with dev-replace [BUG] There is a bug report that a BUG_ON() in btrfs_repair_io_failure() (originally repair_io_failure() in v6.0 kernel) got triggered when replacing a unreliable disk: BTRFS warning (device sda1): csum failed root 257 ino 2397453 off 39624704 csum 0xb0d18c75 expected csum 0x4dae9c5e mirror 3 kernel BUG at fs/btrfs/extent_io.c:2380! invalid opcode: 0000 [#1] PREEMPT SMP NOPTI CPU: 9 PID: 3614331 Comm: kworker/u257:2 Tainted: G OE 6.0.0-5-amd64 #1 Debian 6.0.10-2 Hardware name: Micro-Star International Co., Ltd. MS-7C60/TRX40 PRO WIFI (MS-7C60), BIOS 2.70 07/01/2021 Workqueue: btrfs-endio btrfs_end_bio_work [btrfs] RIP: 0010:repair_io_failure+0x24a/0x260 [btrfs] Call Trace: <TASK> clean_io_failure+0x14d/0x180 [btrfs] end_bio_extent_readpage+0x412/0x6e0 [btrfs] ? __switch_to+0x106/0x420 process_one_work+0x1c7/0x380 worker_thread+0x4d/0x380 ? rescuer_thread+0x3a0/0x3a0 kthread+0xe9/0x110 ? kthread_complete_and_exit+0x20/0x20 ret_from_fork+0x22/0x30 [CAUSE] Before the BUG_ON(), we got some read errors from the replace target first, note the mirror number (3, which is beyond RAID1 duplication, thus it's read from the replace target device). Then at the BUG_ON() location, we are trying to writeback the repaired sectors back the failed device. The check looks like this: ret = btrfs_map_block(fs_info, BTRFS_MAP_WRITE, logical, &map_length, &bioc, mirror_num); if (ret) goto out_counter_dec; BUG_ON(mirror_num != bioc->mirror_num); But inside btrfs_map_block(), we can modify bioc->mirror_num especially for dev-replace: if (dev_replace_is_ongoing && mirror_num == map->num_stripes + 1 && !need_full_stripe(op) && dev_replace->tgtdev != NULL) { ret = get_extra_mirror_from_replace(fs_info, logical, *length, dev_replace->srcdev->devid, &mirror_num, &physical_to_patch_in_first_stripe); patch_the_first_stripe_for_dev_replace = 1; } Thus if we're repairing the replace target device, we're going to trigger that BUG_ON(). But in reality, the read failure from the replace target device may be that, our replace hasn't reached the range we're reading, thus we're reading garbage, but with replace running, the range would be properly filled later. Thus in that case, we don't need to do anything but let the replace routine to handle it. [FIX] Instead of a BUG_ON(), just skip the repair if we're repairing the device replace target device.
Source: CVE Program / CVE List V5
CVSS Information
N/A
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存在安全漏洞,该漏洞源于btrfs在设备替换期间处理修复不当,可能导致空指针取消引用。
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 ad6d620e2a5704f6bf3a39c92a75aad962c51cb3 ~ a7018b40b49c37fb55736499f790ec0d2b381ae4 -
Linux Linux 3.8 -

II. Public POCs for CVE-2023-54180

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

No public POC found.

Login to generate AI POC

III. Intelligence Information for CVE-2023-54180

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

Other References for CVE-2023-54180 (3)

Same Patch Batch · Linux · 2025-12-30 · 244 CVEs total

CVE-2023-54184 9.8 CRITICAL scsi: target: iscsit: Free cmds before session free
CVE-2023-54223 9.8 CRITICAL net/mlx5e: xsk: Fix invalid buffer access for legacy rq
CVE-2023-54237 9.8 CRITICAL net/smc: fix potential panic dues to unprotected smc_llc_srv_add_link()
CVE-2023-54257 9.8 CRITICAL net: macb: fix a memory corruption in extended buffer descriptor mode
CVE-2023-54258 9.8 CRITICAL cifs: fix potential oops in cifs_oplock_break
CVE-2023-54269 9.8 CRITICAL SUNRPC: double free xprt_ctxt while still in use
CVE-2023-54280 9.8 CRITICAL cifs: fix potential race when tree connecting ipc
CVE-2023-54292 9.8 CRITICAL RDMA/irdma: Fix data race on CQP request done
CVE-2023-54203 9.1 CRITICAL ksmbd: fix slab-out-of-bounds in init_smb2_rsp_hdr
CVE-2022-50880 8.8 HIGH wifi: ath10k: add peer map clean up for peer delete in ath10k_sta_state()
CVE-2023-54262 8.8 HIGH net/mlx5e: Don't clone flow post action attributes second time
CVE-2023-54214 8.8 HIGH Bluetooth: L2CAP: Fix potential user-after-free
CVE-2023-54162 8.8 HIGH ksmbd: fix possible memory leak in smb2_lock()
CVE-2023-54318 8.8 HIGH net/smc: use smc_lgr_list.lock to protect smc_lgr_list.list iterate in smcr_port_add
CVE-2023-54250 8.2 HIGH ksmbd: avoid out of bounds access in decode_preauth_ctxt()
CVE-2023-54164 8.0 HIGH Bluetooth: ISO: fix iso_conn related locking and validity issues
CVE-2023-54206 7.8 HIGH net/sched: flower: fix filter idr initialization
CVE-2023-54202 7.8 HIGH drm/i915: fix race condition UAF in i915_perf_add_config_ioctl
CVE-2023-54210 7.8 HIGH Bluetooth: hci_sync: Avoid use-after-free in dbg for hci_remove_adv_monitor()
CVE-2023-54243 7.8 HIGH netfilter: ebtables: fix table blob use-after-free

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

IV. Related Vulnerabilities

V. Comments for CVE-2023-54180

No comments yet


Leave a comment