🇰🇷 한글 설명
Linux kernel NFSv4.0 LOCK 재시도 캐시가 112바이트의 작은 버퍼에 최대 1024바이트의 LOCK 거부 응답을 무경계 복사하면서 최대 944바이트 힙 오버플로우를 야기합니다. 인증 없는 원격 공격자가 두 개의 협력하는 NFSv4.0 클라이언트로 큰 owner 문자열을 가진 lock을 설정 후 충돌하는 lock을 요청하여 원격 트리거 가능합니다. 수정은 응답 길이를 버퍼 크기와 비교 후 초과 시 캐싱을 스킵하는 방식입니다.
💡 쉬운 설명
Linux의 파일 공유 네트워크(NFS)에서 작은 메모리 공간에 큰 데이터를 무분별하게 쓰면서 인접한 메모리가 손상되는 문제입니다. 누구나 인터넷을 통해 특별한 권한 없이 두 개의 요청으로 이를 원격 유발할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
nfsd: fix heap overflow in NFSv4.0 LOCK replay cache
The NFSv4.0 replay cache uses a fixed 112-byte inline buffer
(rp_ibuf[NFSD4_REPLAY_ISIZE]) to store encoded operation responses.
This size was calculated based on OPEN responses and does not account
for LOCK denied responses, which include the conflicting lock owner as
a variable-length field up to 1024 bytes (NFS4_OPAQUE_LIMIT).
When a LOCK operation is denied due to a conflict with an existing lock
that has a large owner, nfsd4_encode_operation() copies the full encoded
response into the undersized replay buffer via read_bytes_from_xdr_buf()
with no bounds check. This results in a slab-out-of-bounds write of up
to 944 bytes past the end of the buffer, corrupting adjacent heap memory.
This can be triggered remotely by an unauthenticated attacker with two
cooperating NFSv4.0 clients: one sets a lock with a large owner string,
then the other requests a conflicting lock to provoke the denial.
We could fix this by increasing NFSD4_REPLAY_ISIZE to allow for a full
opaque, but that would increase the size of every stateowner, when most
lockowners are not that large.
Instead, fix this by checking the encoded response length against
NFSD4_REPLAY_ISIZE before copying into the replay buffer. If the
response is too large, set rp_buflen to 0 to skip caching the replay
payload. The status is still cached, and the client already received the
correct response on the original request.
📍 영향받는 시스템
NFSv4.0 서버 기능이 활성화된 모든 Linux kernel 버전의 nfsd 모듈
⚔️ 공격 벡터
인증 없는 원격 공격자가 협력하는 두 NFSv4.0 클라이언트로 대형 owner 문자열 lock 설정 후 충돌 lock 요청 전송
🛡️ 대응 방법
Linux kernel을 최신 보안 패치 버전으로 업데이트하거나 필요 없으면 NFSv4.0 서버 기능 비활성화
🔧 검증 코드
커널 버전과 nfsd 모듈 버전 확인 후 보안 업데이트 여부 확인, 모듈이 없으면 영향 없음
uname -r && modinfo nfsd 2>/dev/null | grep -i version || echo 'NFSD not installed'