🇰🇷 한글 설명
Linux 커널의 eventfs에서 inode가 해제될 때 rcu list head와 children field가 union으로 공유되어 발생하는 취약점입니다. SRCU 보호 목록을 순회하는 과정에서 메모리 장벽(memory barrier) 부재로 인해 잘못된 메모리 주소를 참조하여 데이터 오염이 발생할 수 있습니다.
💡 쉬운 설명
컴퓨터가 데이터를 정리하는 과정에서 메모리 주소를 헷갈려 잘못된 곳을 읽는 문제입니다. 이로 인해 시스템이 불안정해지거나 보안 문제가 생길 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
eventfs: Use children field for rcu head and add memory barriers
When an eventfs inode is freed, it sets ei->is_freed and then uses its
ei->list to add it to the srcu link list as the list field is a union with
the rcu list head. As the ei->list is used to iterate over an SRCU
protected list without taking the eventfs_mutex, there's nothing stopping
the iteration over that list to see the ei->rcu instead of the ei->list
and it will read a corrupt target.
To fix this, change the union of the rcu list head with the children list.
On freeing the eventfs inode, set the is_free and execute a smp_wmb()
before adding the eventfs inode to the SRCU list.
On iteration of the ei->children list, at the start, execute a smp_rmb()
and then read the is_freed of the ei to see if the children list is still
valid. If is_freed is set, then the ei_child read is not valid and the
loop should exit immediately.
📍 영향받는 시스템
Linux Kernel (eventfs 관련 모듈을 사용하는 버전)
⚔️ 공격 벡터
특정 조건에서 eventfs inode를 해제하여 메모리 레이스 컨디션을 유도함으로써 잘못된 메모리 참조 유발
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 rcu head와 children field의 union 구조를 변경하고 메모리 장벽을 적용해야 합니다.
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인합니다.