🇰🇷 한글 설명
Linux 커널의 lib/buildid 코드에서 sleepable 컨텍스트 처리 방식을 수정한 항목입니다. 기존에는 page cache에 직접 접근하던 freader 로직을 __kernel_read()로 변경하여, filemap_read_folio에서 NULL 포인터 역참조가 발생하던 커널 패닉 문제를 해결합니다.
💡 쉬운 설명
리눅스 커널이 특정 상황에서 파일을 읽을 때 잘못된 메모리 접근으로 멈추는 버그를 수정한 것입니다. 파일 읽기를 커널의 표준 인터페이스로 바꿔 안정성을 높였습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
lib/buildid: use __kernel_read() for sleepable context
Prevent a "BUG: unable to handle kernel NULL pointer dereference in
filemap_read_folio".
For the sleepable context, convert freader to use __kernel_read() instead
of direct page cache access via read_cache_folio(). This simplifies the
faultable code path by using the standard kernel file reading interface
which handles all the complexity of reading file data.
At the moment we are not changing the code for non-sleepable context which
uses filemap_get_folio() and only succeeds if the target folios are
already in memory and up-to-date. The reason is to keep the patch simple
and easier to backport to stable kernels.
Syzbot repro does not crash the kernel anymore and the selftests run
successfully.
In the follow up we will make __kernel_read() with IOCB_NOWAIT work for
non-sleepable contexts. In addition, I would like to replace the
secretmem check with a more generic approach and will add fstest for the
buildid code.
📍 영향받는 시스템
패치 이전의 Linux 커널 (lib/buildid를 사용하는 버전, 정확한 범위는 배포판 권고 확인 필요)
⚔️ 공격 벡터
로컬 사용자가 buildid 파일 읽기 경로를 트리거해 커널 NULL 포인터 역참조로 시스템 불안정 또는 서비스 거부를 유발할 수 있음
🛡️ 대응 방법
배포판에서 제공하는 최신 커널 보안 업데이트를 적용하고 재부팅
🔧 검증 코드
출력된 커널 버전을 배포판 보안 권고(예: Ubuntu/RHEL CVE 페이지)의 패치 적용 버전과 비교하여, 해당 수정이 포함된 빌드인지 확인합니다.