🇰🇷 한글 설명
리눅스 커널의 dm cache policy smq에서 무효화(invalidate) 과정 중 잠금(lock) 범위 설정 오류로 인해 발생하는 레이스 컨디션 취약점입니다. 할당 여부를 확인하는 체크 로직이 임계 구역 밖에 위치하여, 두 개의 프로세스가 동시에 동일한 엔트리를 무효화하려고 할 때 데이터 구조가 손상되거나 중복 해제가 발생할 수 있습니다.
💡 쉬운 설명
두 명의 작업자가 동시에 같은 물건을 치우려고 할 때, 물건이 이미 치워졌는지 확인하는 절차가 제대로 보호되지 않아 발생하는 문제입니다. 이로 인해 시스템의 중요한 관리 목록이 엉키거나 오류가 발생하여 시스템이 불안정해질 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
dm cache policy smq: check allocation under invalidate lock
commit 2d1f7b65f5de ("dm cache policy smq: fix missing locks in
invalidating cache blocks") added mq->lock around the destructive part of
smq_invalidate_mapping(), but left the e->allocated check outside the
critical section.
That leaves a check-then-act race. Two concurrent invalidators can both
observe e->allocated as true before either of them takes mq->lock. The
first invalidator that acquires the lock removes the entry from the
queues and hash table and then calls free_entry(), which clears
e->allocated and puts the entry back on the free list. The second
invalidator can then acquire mq->lock and continue with the stale result
of the unlocked check.
This can corrupt the SMQ queues or hash table by deleting an entry that
is no longer on those structures. It can also hit the allocation check in
free_entry() when the same entry is freed again.
Move the allocation check under mq->lock so the predicate and the
destructive operations are serialized by the same lock.
📍 영향받는 시스템
Linux kernel (dm cache policy smq 관련 모듈 사용 시스템)
⚔️ 공격 벡터
동시에 여러 개의 무효화 요청을 보내는 레이스 컨디션 공격
🛡️ 대응 방법
커널 패치(commit 2d1f7b65f5de)를 적용하여 할당 확인 로직을 mq->lock 임계 구역 내부로 이동
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 패치가 적용된 최신 버전인지 확인합니다.