🇰🇷 한글 설명
Linux 커널의 BPF 맵 처리 과정에서 TOCTOU(Time-of-Check to Time-of-Use) 취약점이 발견되었습니다. 맵이 동결(frozen)되지 않은 상태에서도 해시값이 계산되어, 신뢰할 수 있는 로더가 변경된 내용을 검증하지 못하고 잘못된 해시값을 신뢰할 수 있는 문제가 있습니다.
💡 쉬운 설명
데이터가 고정되기 전에 미리 계산된 값을 이용해, 데이터가 몰래 바뀌어도 검사 시스템이 이를 알아채지 못하게 속일 수 있는 보안 허점입니다. 공격자가 검사 단계와 실제 사용 단계 사이의 시간차를 이용해 데이터를 조작할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
bpf: Require frozen map for calculating map hash
Currently, bpf_map_get_info_by_fd calculates and caches the hash of the
map regardless of the map's frozen state.
This leads to a TOCTOU bug where userspace can call
BPF_OBJ_GET_INFO_BY_FD to cache the hash and then modify the map
contents before freezing.
Therefore, a trusted loader can be tricked into verifying the stale hash
while loading the modified contents.
Fix this by returning -EPERM if the map is not frozen when the hash is
requested. This ensures the hash is only generated for the final,
immutable state of the map.
📍 영향받는 시스템
Linux kernel (BPF 기능이 활성화된 시스템)
⚔️ 공격 벡터
사용자 공간에서 BPF_OBJ_GET_INFO_BY_FD를 호출하여 해시를 캐싱한 후, 맵이 동결되기 전에 내용을 수정하는 방식
🛡️ 대응 방법
해시 요청 시 맵이 동결 상태가 아니면 -EPERM 오류를 반환하도록 커널을 업데이트해야 합니다.
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 패치된 최신 보안 업데이트 버전인지 확인합니다.