🔍 CVE-2022-50435

5.5
CVSS Score
MEDIUM
2025-10-01
2026-11-05 21:16
✅ 완료

🇰🇷 한글 설명

Linux 커널 ext4 파일시스템에서, 직접 I/O(DIO)로 쓰기를 수행한 inode에 대해 EXT4_STATE_MAY_INLINE_DATA 플래그가 해제되지 않아 이후 truncate 후 일반 쓰기 시 일반 블록과 인라인 데이터가 동시에 할당되어 커널 BUG가 발생하는 문제입니다. DIO 쓰기 시 해당 플래그를 클리어하도록 수정되었습니다.

💡 쉬운 설명

직접 입출력 방식으로 쓴 파일을 나중에 줄인 뒤 일반 방식으로 쓰면 리눅스 커널이 비정상 상태에 빠져 시스템이 멈출 수 있습니다. 이 문제는 파일시스템 내부의 상태 관리 오류에서 비롯됩니다.

🇺🇸 원문 (English)

In the Linux kernel, the following vulnerability has been resolved: ext4: avoid crash when inline data creation follows DIO write When inode is created and written to using direct IO, there is nothing to clear the EXT4_STATE_MAY_INLINE_DATA flag. Thus when inode gets truncated later to say 1 byte and written using normal write, we will try to store the data as inline data. This confuses the code later because the inode now has both normal block and inline data allocated and the confusion manifests for example as: kernel BUG at fs/ext4/inode.c:2721! invalid opcode: 0000 [#1] PREEMPT SMP KASAN CPU: 0 PID: 359 Comm: repro Not tainted 5.19.0-rc8-00001-g31ba1e3b8305-dirty #15 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.0-1.fc36 04/01/2014 RIP: 0010:ext4_writepages+0x363d/0x3660 RSP: 0018:ffffc90000ccf260 EFLAGS: 00010293 RAX: ffffffff81e1abcd RBX: 0000008000000000 RCX: ffff88810842a180 RDX: 0000000000000000 RSI: 0000008000000000 RDI: 0000000000000000 RBP: ffffc90000ccf650 R08: ffffffff81e17d58 R09: ffffed10222c680b R10: dfffe910222c680c R11: 1ffff110222c680a R12: ffff888111634128 R13: ffffc90000ccf880 R14: 0000008410000000 R15: 0000000000000001 FS: 00007f72635d2640(0000) GS:ffff88811b000000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000565243379180 CR3: 000000010aa74000 CR4: 0000000000150eb0 Call Trace: <TASK> do_writepages+0x397/0x640 filemap_fdatawrite_wbc+0x151/0x1b0 file_write_and_wait_range+0x1c9/0x2b0 ext4_sync_file+0x19e/0xa00 vfs_fsync_range+0x17b/0x190 ext4_buffered_write_iter+0x488/0x530 ext4_file_write_iter+0x449/0x1b90 vfs_write+0xbcd/0xf40 ksys_write+0x198/0x2c0 __x64_sys_write+0x7b/0x90 do_syscall_64+0x3d/0x90 entry_SYSCALL_64_after_hwframe+0x63/0xcd </TASK> Fix the problem by clearing EXT4_STATE_MAY_INLINE_DATA when we are doing direct IO write to a file.

📍 영향받는 시스템

패치 이전의 Linux 커널 (ext4 파일시스템 사용 환경, 5.19-rc 계열 이후 해당 코드 포함 버전)

⚔️ 공격 벡터

로컬 사용자가 ext4 파일시스템에서 DIO 쓰기, truncate, 일반 쓰기 순서로 파일 작업을 수행해 커널 BUG(패닉)를 유발할 수 있습니다.

🛡️ 대응 방법

배포판 제공 보안 업데이트를 통해 수정된 커널로 업그레이드하고 재부팅합니다.

🔧 검증 코드

출력된 커널 버전이 배포판의 수정 버전 이상인지 보안 공지와 대조하고, ext4 항목이 보이면 해당 파일시스템 지원이 활성화되어 있어 영향을 받을 수 있는 환경임을 의미합니다.

Shell / Script
uname -r && grep -i ext4 /proc/filesystems 2>/dev/null

📊 CVSS Vector String

CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

💻 영향받는 소프트웨어

Linux Kernel