🇰🇷 한글 설명
Linux 커널의 f2fs 파일 시스템에서 quota_release_work가 WQ_MEM_RECLAIM 플래그가 없는 'events_unbound' 큐를 사용하여 발생하는 문제입니다. 동기식 쓰기 작업 중 f2fs 밸런싱이 필요할 때 해당 작업을 플러시하려고 시도하면, 플래그 불일치로 인해 커널 패닉이 발생할 수 있습니다.
💡 쉬운 설명
파일 시스템의 용량 제한(quota)을 관리하는 작업이 잘못된 방식으로 처리되어 컴퓨터 시스템이 갑자기 멈추거나 꺼질 수 있는 오류입니다. 특정 상황에서 시스템이 스스로를 보호하기 위해 강제로 중단되는 현상이 발생합니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
fs: quota: create dedicated workqueue for quota_release_work
There is a kernel panic due to WARN_ONCE when panic_on_warn is set.
This issue occurs when writeback is triggered due to sync call for an
opened file(ie, writeback reason is WB_REASON_SYNC). When f2fs balance
is needed at sync path, flush for quota_release_work is triggered.
By default quota_release_work is queued to "events_unbound" queue which
does not have WQ_MEM_RECLAIM flag. During f2fs balance "writeback"
workqueue tries to flush quota_release_work causing kernel panic due to
MEM_RECLAIM flag mismatch errors.
This patch creates dedicated workqueue with WQ_MEM_RECLAIM flag
for work quota_release_work.
------------[ cut here ]------------
WARNING: CPU: 4 PID: 14867 at kernel/workqueue.c:3721 check_flush_dependency+0x13c/0x148
Call trace:
check_flush_dependency+0x13c/0x148
__flush_work+0xd0/0x398
flush_delayed_work+0x44/0x5c
dquot_writeback_dquots+0x54/0x318
f2fs_do_quota_sync+0xb8/0x1a8
f2fs_write_checkpoint+0x3cc/0x99c
f2fs_gc+0x190/0x750
f2fs_balance_fs+0x110/0x168
f2fs_write_single_data_page+0x474/0x7dc
f2fs_write_data_pages+0x7d0/0xd0c
do_writepages+0xe0/0x2f4
__writeback_single_inode+0x44/0x4ac
writeback_sb_inodes+0x30c/0x538
wb_writeback+0xf4/0x440
wb_workfn+0x128/0x5d4
process_scheduled_works+0x1c4/0x45c
worker_thread+0x32c/0x3e8
kthread+0x11c/0x1b0
ret_from_fork+0x10/0x20
Kernel panic - not syncing: kernel: panic_on_warn set ...
📍 영향받는 시스템
Linux kernel (f2fs 파일 시스템을 사용하는 시스템)
⚔️ 공격 벡터
로컬 사용자가 특정 파일 시스템 작업(sync call 등)을 유도하여 커널 패닉을 일으킬 수 있음
🛡️ 대응 방법
quota_release_work를 위해 WQ_MEM_RECLAIM 플래그가 설정된 전용 워크큐를 생성하는 커널 패치를 적용하십시오.
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 해결된 최신 패치 버전인지 확인하십시오.