nday
CVE-2023-54180

btrfs: handle case when repair happens with dev-replace

Linux / Linux

CVE 공개: . nday가 아직 패치 근거를 수집하지 않았습니다. 패치가 없다는 뜻은 아닙니다. PoC 출처 4곳 모두 미등재. CISA KEV 미등재.

tags productLinux kernel product typeoperating system
why these tags

nday derives these tags by fixed rules from the facts below; NVD, the CNA and other sources do not assign them. Vocabulary and rules: ~/tags.

Linux kernel
affected products in the CVE record: Linux · Linux
operating system
affected products in the CVE record: Linux · Linuxthe product type of Linux kernel in nday's product registry
현재 단계
DIS
공개
CVSS
점수 없음

생명주기

가로축 UTC. 점 = 분 단위, 넓은 막대 = 날짜만, 빈 표시 = 불명 또는 추정.
시점 알 수 없음
DIS공개
2025-12-30T12:08Z
PAT패치
아직 기록 없음
ANA분석
아직 기록 없음
POCPoC
아직 기록 없음
ITW악용
아직 기록 없음
KEVKEV
아직 기록 없음

요약

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.

Original text of the CVE record (cvelist), shown as published.

이벤트 로그

+DISCVE 공개

CVE 레코드 공개(CNA: Linux).

출처 cvelist · nday 일괄 수집 · 원본
{
  "id": 310275,
  "type": "disclosed",
  "source": "cvelist",
  "url": "https://www.cve.org/CVERecord?id=CVE-2023-54180",
  "occurred_at": "2025-12-30T12:08:51.727Z",
  "observed_at": "2026-11-13T05:38:14.046808Z",
  "is_backfill": true,
  "dedupe_key": "",
  "detail": {
    "state": "PUBLISHED",
    "date_published": "2025-12-30T12:08:51.727Z",
    "assigner_short_name": "Linux"
  }
}

Report an error

report an error or omission

Something on this page wrong or missing? Tell the editors; if they accept it, this page's revision log says so publicly. Upstream data is not changed.

연구자 논의

최근 7일간 연구자 0명이 언급

목록의 연구자가 X에서 이 CVE를 언급한 게시물입니다. 원문 그대로 보여 주며 nday는 검증하지 않습니다.

명단의 연구자가 X에서 이 CVE를 언급한 게시물은 아직 수집되지 않았습니다.

Discussion

0 comments

No comments yet.