🇰🇷 한글 설명
Linux 커널의 memcg 리페어런팅 과정에서 xarray 항목을 먼저 삭제하여 발생하는 레이스 컨디션 취약점입니다. 이로 인해 동시 실행 중인 list_lru_del 작업이 잘못된 락을 획득하여 리스트 포인터를 손상시키고 메모리 오염을 유발할 수 있습니다.
💡 쉬운 설명
메모리를 관리하는 과정에서 순서가 잘못되어, 데이터가 옮겨지기 전에 연결 고리를 끊어버리는 문제입니다. 이로 인해 시스템의 데이터 연결이 꼬여 프로그램이 충돌하거나 보안 문제가 생길 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
mm/list_lru: drain before clearing xarray entry on reparent
memcg_reparent_list_lrus() clears the dying memcg's xarray entry with
xas_store(&xas, NULL) before reparenting its per-node lists into the
parent. This opens a window where a concurrent list_lru_del() arriving
for the dying memcg sees xa_load() == NULL, walks to the parent in
lock_list_lru_of_memcg(), takes the parent's per-node lock, and calls
list_del_init() on an item still physically linked on the dying memcg's
list.
If another in-flight thread holds the dying memcg's per-node lock at the
same moment (another list_lru_del, or a list_lru_walk_one running an
isolate callback), both threads modify ->next/->prev pointers on the same
physical list under different locks. Adjacent items can corrupt each
other's links.
Fix it by reversing the order: reparent each per-node list and mark the
child's list lru dead and then clear the xarray entry. Any concurrent
list_lru op that finds the still-set xarray entry either takes the dying
memcg's per-node lock (synchronizing with the drain) or sees LONG_MIN and
walks to the parent, where the items now live.
📍 영향받는 시스템
Linux Kernel (mm/list_lru 관련 모듈 사용 시스템)
⚔️ 공격 벡터
메모리 관리 작업이 동시에 일어나는 상황을 이용한 레이스 컨디션 공격
🛡️ 대응 방법
리페어런팅 순서를 변경하여 리스트를 먼저 옮긴 후 xarray 항목을 삭제하도록 커널 패치 적용
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 해결된 패치 버전인지 확인합니다.