🔍 CVE-2023-52447

7.8
CVSS Score
HIGH
2024-02-22
2026-10-15 01:17
✅ 완료

🇰🇷 한글 설명

리눅스 커널의 BPF(Berkeley Packet Filter) 구현에서 맵 배열 또는 htab의 내부 맵을 업데이트하거나 삭제할 때 발생하는 Use-After-Free 취약점입니다. 기존 방식은 RCU grace period를 기다리지 않고 내부 맵을 즉시 해제하여, 해당 맵에 접근 중인 BPF 프로그램이 해제된 메모리에 접근할 수 있는 문제가 있었습니다.

💡 쉬운 설명

컴퓨터가 사용 중인 데이터를 너무 빨리 지워버려서, 데이터가 사라진 줄 모르고 접근하려다 시스템 오류나 보안 문제가 발생하는 현상입니다. 이를 방지하기 위해 데이터 사용이 완전히 끝날 때까지 기다린 후 삭제하도록 수정되었습니다.

🇺🇸 원문 (English)

In the Linux kernel, the following vulnerability has been resolved: bpf: Defer the free of inner map when necessary When updating or deleting an inner map in map array or map htab, the map may still be accessed by non-sleepable program or sleepable program. However bpf_map_fd_put_ptr() decreases the ref-counter of the inner map directly through bpf_map_put(), if the ref-counter is the last one (which is true for most cases), the inner map will be freed by ops->map_free() in a kworker. But for now, most .map_free() callbacks don't use synchronize_rcu() or its variants to wait for the elapse of a RCU grace period, so after the invocation of ops->map_free completes, the bpf program which is accessing the inner map may incur use-after-free problem. Fix the free of inner map by invoking bpf_map_free_deferred() after both one RCU grace period and one tasks trace RCU grace period if the inner map has been removed from the outer map before. The deferment is accomplished by using call_rcu() or call_rcu_tasks_trace() when releasing the last ref-counter of bpf map. The newly-added rcu_head field in bpf_map shares the same storage space with work field to reduce the size of bpf_map.

📍 영향받는 시스템

RCU grace period 처리가 미흡한 버전의 Linux Kernel (BPF 기능 사용 시)

⚔️ 공격 벡터

특수하게 조작된 BPF 프로그램을 실행하여 내부 맵의 참조 카운터를 조작함으로써 Use-After-Free 유도

🛡️ 대응 방법

리눅스 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 bpf_map_free_deferred() 로직 적용

🔧 검증 코드

출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인

Shell / Script
uname -r

📊 CVSS Vector String

CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

💻 영향받는 소프트웨어

Linux Kernel