🇰🇷 한글 설명
Linux 커널의 BPF 콜백 프레임 처리 과정에서 내부 맵의 식별자(map_uid)가 초기화되어 발생하는 취약점입니다. 이로 인해 서로 다른 내부 맵이 동일한 템플릿으로 오인되어, 이미 해제된 메모리 영역을 참조하는 Use-After-Free 오류가 발생할 수 있습니다.
💡 쉬운 설명
컴퓨터가 서로 다른 두 개의 데이터를 같은 데이터라고 착각하여, 이미 삭제된 데이터를 다시 사용하려고 시도하는 문제입니다. 이 과정에서 시스템이 충돌하거나 보안 문제가 생길 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
bpf: Preserve inner map identity in callback frames
Callback frame constructors initialize map-typed argument registers with
__mark_reg_known_zero() and then restore map_ptr. This clears map_uid,
which is the only field distinguishing inner maps that share an
inner_map_meta template.
When a timer callback invokes bpf_for_each_map_elem() on a second inner
map, both the saved first map and the second map value can reach the nested
callback as the same template with map_uid zero. bpf_timer_init() then
accepts pairing the timer from the second map with the first map.
The runtime records the first map in the timer without taking a reference.
Freeing that map does not find the timer stored in the second map, so a
later timer callback dereferences the freed map.
Copy map_uid from the same caller register as map_ptr when constructing
for-each, timer/workqueue, and task-work callback arguments. The existing
identity check can then reject mismatched inner maps while allowing a
callback value to be paired with its actual map.
📍 영향받는 시스템
Linux kernel (BPF 기능이 활성화된 모든 버전)
⚔️ 공격 벡터
특수하게 조작된 BPF 타이머 콜백을 사용하여 메모리 해제 후 참조(Use-After-Free) 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인합니다.