🇰🇷 한글 설명
리눅스 커널의 jbd2 구성 요소에서 파일 시스템이 손상되었을 때 발생하는 취약점입니다. 파일 시스템 데이터 불일치 상황에서 특정 조건이 충족되지 않을 경우 BUG_ON 명령이 실행되어 시스템이 충돌(Crash)할 수 있습니다.
💡 쉬운 설명
파일 시스템에 오류가 생겼을 때 컴퓨터가 이를 처리하지 못하고 갑자기 멈추거나 꺼질 수 있는 문제입니다. 데이터가 꼬인 상황에서 시스템이 안전하게 대처하지 못하고 오류를 일으키는 현상입니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
jbd2: avoid bug_on in jbd2_journal_get_create_access() when file system corrupted
There's issue when file system corrupted:
------------[ cut here ]------------
kernel BUG at fs/jbd2/transaction.c:1289!
Oops: invalid opcode: 0000 [#1] SMP KASAN PTI
CPU: 5 UID: 0 PID: 2031 Comm: mkdir Not tainted 6.18.0-rc1-next
RIP: 0010:jbd2_journal_get_create_access+0x3b6/0x4d0
RSP: 0018:ffff888117aafa30 EFLAGS: 00010202
RAX: 0000000000000000 RBX: ffff88811a86b000 RCX: ffffffff89a63534
RDX: 1ffff110200ec602 RSI: 0000000000000004 RDI: ffff888100763010
RBP: ffff888100763000 R08: 0000000000000001 R09: ffff888100763028
R10: 0000000000000003 R11: 0000000000000000 R12: 0000000000000000
R13: ffff88812c432000 R14: ffff88812c608000 R15: ffff888120bfc000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f91d6970c99 CR3: 00000001159c4000 CR4: 00000000000006f0
Call Trace:
<TASK>
__ext4_journal_get_create_access+0x42/0x170
ext4_getblk+0x319/0x6f0
ext4_bread+0x11/0x100
ext4_append+0x1e6/0x4a0
ext4_init_new_dir+0x145/0x1d0
ext4_mkdir+0x326/0x920
vfs_mkdir+0x45c/0x740
do_mkdirat+0x234/0x2f0
__x64_sys_mkdir+0xd6/0x120
do_syscall_64+0x5f/0xfa0
entry_SYSCALL_64_after_hwframe+0x76/0x7e
The above issue occurs with us in errors=continue mode when accompanied by
storage failures. There have been many inconsistencies in the file system
data.
In the case of file system data inconsistency, for example, if the block
bitmap of a referenced block is not set, it can lead to the situation where
a block being committed is allocated and used again. As a result, the
following condition will not be satisfied then trigger BUG_ON. Of course,
it is entirely possible to construct a problematic image that can trigger
this BUG_ON through specific operations. In fact, I have constructed such
an image and easily reproduced this issue.
Therefore, J_ASSERT() holds true only under ideal conditions, but it may
not necessarily be satisfied in exceptional scenarios. Using J_ASSERT()
directly in abnormal situations would cause the system to crash, which is
clearly not what we want. So here we directly trigger a JBD abort instead
of immediately invoking BUG_ON.
📍 영향받는 시스템
Linux kernel (특히 6.18.0-rc1-next 및 jbd2/ext4를 사용하는 시스템)
⚔️ 공격 벡터
손상된 파일 시스템 이미지 또는 스토리지 오류를 유도하여 커널 패닉(Kernel Panic) 발생
🛡️ 대응 방법
jbd2의 BUG_ON 대신 JBD abort를 사용하도록 수정된 최신 리눅스 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 취약점이 해결된 패치 버전인지 확인