🇰🇷 한글 설명
Linux 커널의 netfs 서브시스템에서 ITER_KVEC 타입 이터레이터를 처리하지 못해 kernel BUG이 발생한다. 코어 덤프를 9P 파일시스템에 작성할 때 __kernel_write()가 ITER_KVEC 이터레이터를 생성하면서 문제가 트리거되며, netfs_limit_iter()에 netfs_limit_kvec() 함수를 추가하여 해결된다.
💡 쉬운 설명
Linux 커널에서 메모리 데이터를 특정 형식으로 변환할 때 처리하지 못하는 타입이 있어서 시스템이 중단된다. 프로그램이 크래시되어 덤프 파일을 저장할 때 이 문제가 발생할 수 있다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
netfs: Fix kernel BUG in netfs_limit_iter() for ITER_KVEC iterators
When a process crashes and the kernel writes a core dump to a 9P
filesystem, __kernel_write() creates an ITER_KVEC iterator. This
iterator reaches netfs_limit_iter() via netfs_unbuffered_write(), which
only handles ITER_FOLIOQ, ITER_BVEC and ITER_XARRAY iterator types,
hitting the BUG() for any other type.
Fix this by adding netfs_limit_kvec() following the same pattern as
netfs_limit_bvec(), since both kvec and bvec are simple segment arrays
with pointer and length fields. Dispatch it from netfs_limit_iter() when
the iterator type is ITER_KVEC.
📍 영향받는 시스템
Linux kernel 5.15 이상의 netfs를 포함한 시스템, 특히 9P 파일시스템 사용 환경
⚔️ 공격 벡터
로컬 공격자가 의도적으로 프로세스를 크래시하여 코어 덤프 작성 시 kernel panic 트리거
🛡️ 대응 방법
Linux 커널을 최신 버전으로 업데이트하여 netfs_limit_kvec() 패치 적용
🔧 검증 코드
패치가 적용되었으면 /proc/kallsyms에서 netfs_limit_kvec 심볼이 검색되고 'Patched'라고 출력된다.
uname -r && grep -q 'netfs_limit_kvec' /proc/kallsyms 2>/dev/null && echo 'Patched' || echo 'Unpatched'