🇰🇷 한글 설명
Linux 커널의 Btrfs 파일 시스템에서 Zoned 장치 사용 시, dirty 상태가 아닌 extent buffer에 ZEROOUT 플래그를 잘못 설정하는 취약점이 발견되었습니다. 이로 인해 잘못된 지연 참조 항목이 추가되어 파일 시스템이 손상(EUCLEAN 오류)되거나 디스크에 초기화된 트리 노드가 기록될 수 있습니다.
💡 쉬운 설명
파일 시스템이 데이터를 저장하는 과정에서 실수로 데이터를 지워버려 파일 시스템 구조가 망가질 수 있는 문제입니다. 이로 인해 컴퓨터가 파일 시스템 오류를 일으키며 정상적으로 작동하지 않을 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
btrfs: zoned: do not flag ZEROOUT on non-dirty extent buffer
Btrfs clears the content of an extent buffer marked as
EXTENT_BUFFER_ZONED_ZEROOUT before the bio submission. This mechanism is
introduced to prevent a write hole of an extent buffer, which is once
allocated, marked dirty, but turns out unnecessary and cleaned up within
one transaction operation.
Currently, btrfs_clear_buffer_dirty() marks the extent buffer as
EXTENT_BUFFER_ZONED_ZEROOUT, and skips the entry function. If this call
happens while the buffer is under IO (with the WRITEBACK flag set,
without the DIRTY flag), we can add the ZEROOUT flag and clear the
buffer's content just before a bio submission. As a result:
1) it can lead to adding faulty delayed reference item which leads to a
FS corrupted (EUCLEAN) error, and
2) it writes out cleared tree node on disk
The former issue is previously discussed in [1]. The corruption happens
when it runs a delayed reference update. So, on-disk data is safe.
[1] https://lore.kernel.org/linux-btrfs/3f4f2a0ff1a6c818050434288925bdcf3cd719e5.1709124777.git.naohiro.aota@wdc.com/
The latter one can reach on-disk data. But, as that node is already
processed by btrfs_clear_buffer_dirty(), that will be invalidated in the
next transaction commit anyway. So, the chance of hitting the corruption
is relatively small.
Anyway, we should skip flagging ZEROOUT on a non-DIRTY extent buffer, to
keep the content under IO intact.
📍 영향받는 시스템
Linux Kernel (Btrfs 파일 시스템을 사용하는 Zoned 장치 환경)
⚔️ 공격 벡터
로컬 공격자가 특정 파일 시스템 작업(delayed reference update)을 유도하여 파일 시스템 손상을 일으킬 수 있음
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하십시오.
🔧 검증 코드
출력된 커널 버전을 확인하여 해당 취약점이 해결된 최신 패치 버전인지 확인하십시오.