🇰🇷 한글 설명
Linux 커널의 ext4 파일 시스템에서 discard 옵션으로 마운트된 후 nodiscard로 재마운트될 때, 대기 중인 discard 작업이 제대로 처리되지 않는 취약점입니다. 이로 인해 파일 삭제 시 발생하는 데이터 해제 작업이 누락될 수 있습니다.
💡 쉬운 설명
파일을 지울 때 컴퓨터가 '이 공간은 이제 비어있다'라고 기록하는 과정이 있는데, 설정 변경 시 이 기록 과정이 중간에 끊길 수 있는 문제입니다. 이로 인해 데이터 관리의 일관성이 깨질 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
ext4: always drain queued discard work in ext4_mb_release()
While reviewing recent ext4 patch[1], Sashiko raised the following
concern[2]:
> If the filesystem is initially mounted with the discard option,
> deleting files will populate sbi->s_discard_list and queue
> s_discard_work. If it is then remounted with nodiscard, the
> EXT4_MOUNT_DISCARD flag is cleared, but the pending s_discard_work is
> neither cancelled nor flushed.
[1] https://lore.kernel.org/r/
[email protected]/
[2] https://sashiko.dev/#/patchset/20260319094545.19291-1-qiang.zhang%40linux.dev
The concern was valid, but it had nothing to do with the patch[1].
One of the problems with Sashiko in its current (early) form is that
it will detect pre-existing issues and report it as a problem with the
patch that it is reviewing.
In practice, it would be hard to hit deliberately (unless you are a
malicious syzkaller fuzzer), since it would involve mounting the file
system with -o discard, and then deleting a large number of files,
remounting the file system with -o nodiscard, and then immediately
unmounting the file system before the queued discard work has a change
to drain on its own.
Fix it because it's a real bug, and to avoid Sashiko from raising this
concern when analyzing future patches to mballoc.c.
📍 영향받는 시스템
Linux kernel (ext4 filesystem 사용 시스템)
⚔️ 공격 벡터
파일 시스템 마운트 옵션을 의도적으로 변경(discard ↔ nodiscard)하고 즉시 언마운트하는 정교한 조작 필요
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하십시오.
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인하십시오.