🇰🇷 한글 설명
Linux 커널의 batman-adv 모듈에서 백본 게이트웨이 삭제 시 report_work를 적절히 처리하지 못해 발생하는 메모리 누수 및 Use-After-Free 취약점입니다. 기존 코드는 스핀락 내부에서 잠들 수 있는 함수를 호출하여 충돌을 일으켰으나, 루프 구조를 재설계하여 이를 해결했습니다.
💡 쉬운 설명
컴퓨터의 핵심 부품인 커널이 데이터를 정리하는 과정에서, 이미 삭제된 메모리 영역을 다시 사용하려고 시도하여 시스템 오류를 일으킬 수 있는 문제입니다. 이로 인해 시스템이 멈추거나 보안 문제가 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
batman-adv: bla: fix report_work leak on backbone_gw purge
batadv_bla_purge_backbone_gw() removes stale backbone gateway entries,
but fails to properly handle their associated report_work:
- If report_work is running, the purge must wait for it to finish before
freeing the backbone_gw, otherwise the worker may access freed memory
(e.g. bat_priv).
- If report_work is pending, the purge must cancel it and release the
reference held for that pending work item.
The previous implementation called hlist_for_each_entry_safe() inside a
spin_lock_bh() section, but cancel_work_sync() may sleep and therefore
cannot be called from within a spinlock-protected region.
Restructure the loop to handle one entry per spinlock critical section:
acquire the lock, find the next entry to purge, remove it from the hash
list, then release the lock before calling cancel_work_sync() and
dropping the hash_entry reference. Repeat until no more entries require
purging.
📍 영향받는 시스템
Linux kernel (batman-adv 모듈을 사용하는 버전)
⚔️ 공격 벡터
특정 네트워크 환경에서 백본 게이트웨이 엔트리를 대량으로 삭제하거나 조작하여 메모리 오류 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인