🇰🇷 한글 설명
Linux 커널의 netfs 라이브러리에서 RCU 읽기 잠금 하에 xarray를 순회할 때 xas_retry() 호출이 누락되어 있었습니다. 이로 인해 xarray가 내부 특수 값을 반환할 때 잘못된 주소를 역참조하여 커널 패닉(NULL 포인터 역참조)이 발생할 수 있습니다. 누락된 재시도 검사를 추가하여 수정되었습니다.
💡 쉬운 설명
리눅스 커널 내부의 파일 읽기 기능에서 데이터 목록을 탐색하는 중 잘못된 처리가 있어 시스템이 갑자기 멈출 수 있습니다. 이 문제는 커널 업데이트로 해결됩니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
netfs: Fix missing xas_retry() calls in xarray iteration
netfslib has a number of places in which it performs iteration of an xarray
whilst being under the RCU read lock. It *should* call xas_retry() as the
first thing inside of the loop and do "continue" if it returns true in case
the xarray walker passed out a special value indicating that the walk needs
to be redone from the root[*].
Fix this by adding the missing retry checks.
[*] I wonder if this should be done inside xas_find(), xas_next_node() and
suchlike, but I'm told that's not an simple change to effect.
This can cause an oops like that below. Note the faulting address - this
is an internal value (|0x2) returned from xarray.
BUG: kernel NULL pointer dereference, address: 0000000000000402
...
RIP: 0010:netfs_rreq_unlock+0xef/0x380 [netfs]
...
Call Trace:
netfs_rreq_assess+0xa6/0x240 [netfs]
netfs_readpage+0x173/0x3b0 [netfs]
? init_wait_var_entry+0x50/0x50
filemap_read_page+0x33/0xf0
filemap_get_pages+0x2f2/0x3f0
filemap_read+0xaa/0x320
? do_filp_open+0xb2/0x150
? rmqueue+0x3be/0xe10
ceph_read_iter+0x1fe/0x680 [ceph]
? new_sync_read+0x115/0x1a0
new_sync_read+0x115/0x1a0
vfs_read+0xf3/0x180
ksys_read+0x5f/0xe0
do_syscall_64+0x38/0x90
entry_SYSCALL_64_after_hwframe+0x44/0xae
Changes:
========
ver #2)
- Changed an unsigned int to a size_t to reduce the likelihood of an
overflow as per Willy's suggestion.
- Added an additional patch to fix the maths.
📍 영향받는 시스템
netfs 모듈을 사용하는 Linux 커널 (수정 이전 버전, 주로 CephFS 등 네트워크 파일시스템 사용 환경)
⚔️ 공격 벡터
공격자가 netfs 기반 네트워크 파일시스템에서 파일 읽기를 유발하여 커널 충돌(서비스 거부)을 일으킬 수 있으며, 정상 사용 중에도 발생할 수 있습니다.
🛡️ 대응 방법
배포판 공식 저장소를 통해 Linux 커널을 최신 보안 업데이트 버전으로 업그레이드하고 재부팅합니다.
🔧 검증 코드
출력된 커널 버전이 배포판의 수정된 패치 버전 이상인지 확인하고, netfs 또는 ceph 모듈이 로드되어 있는지 확인하여 영향 여부를 판단합니다.
uname -r; lsmod 2>/dev/null | grep -E '^netfs|^ceph'