🇰🇷 한글 설명
Linux 커널의 perf 서브시스템에서, perf 메모리 매핑(링버퍼 및 보조 버퍼)이 mmap(2), munmap(2), mremap(2)로 분할(VMA split)될 수 있어 참조 카운트가 누수되는 문제가 있었습니다. 패치는 vm_operations_struct::may_split() 콜백이 -EINVAL을 반환하도록 하여 매핑 분할을 차단합니다.
💡 쉬운 설명
리눅스 시스템의 성능 분석 기능이 메모리 영역을 잘못 나눌 수 있어, 내부 자원 관리 정보가 꼬이는 문제가 있었습니다. 이제는 해당 메모리 영역을 나누는 작업을 커널이 막아 이 문제를 방지합니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
perf/core: Prevent VMA split of buffer mappings
The perf mmap code is careful about mmap()'ing the user page with the
ringbuffer and additionally the auxiliary buffer, when the event supports
it. Once the first mapping is established, subsequent mapping have to use
the same offset and the same size in both cases. The reference counting for
the ringbuffer and the auxiliary buffer depends on this being correct.
Though perf does not prevent that a related mapping is split via mmap(2),
munmap(2) or mremap(2). A split of a VMA results in perf_mmap_open() calls,
which take reference counts, but then the subsequent perf_mmap_close()
calls are not longer fulfilling the offset and size checks. This leads to
reference count leaks.
As perf already has the requirement for subsequent mappings to match the
initial mapping, the obvious consequence is that VMA splits, caused by
resizing of a mapping or partial unmapping, have to be prevented.
Implement the vm_operations_struct::may_split() callback and return
unconditionally -EINVAL.
That ensures that the mapping offsets and sizes cannot be changed after the
fact. Remapping to a different fixed address with the same size is still
possible as it takes the references for the new mapping and drops those of
the old mapping.
📍 영향받는 시스템
패치 이전의 Linux 커널 버전 (perf 이벤트 및 링버퍼 매핑을 지원하는 배포판 커널 전반, 정확한 범위는 커널 배포사 권고 확인 필요)
⚔️ 공격 벡터
로컬 사용자 권한으로 perf 매핑 영역에 mmap/munmap/mremap을 호출해 VMA를 분할하고 참조 카운트 누수를 유발하는 방식 (로컬 권한 상승 또는 서비스 거부 가능성)
🛡️ 대응 방법
배포판에서 제공하는 보안 업데이트된 Linux 커널로 업그레이드 후 재부팅
🔧 검증 코드
출력된 커널 버전을 배포사 보안 권고문의 수정된 커널 버전과 비교하며, 해당 버전 이상이면 패치가 적용된 것으로 판단하고 미만이면 업데이트가 필요합니다.