🇰🇷 한글 설명
Linux 커널의 netconsole 구성 요소에서 configfs 계층 구조를 탐색할 때 su_mutex를 적절히 획득하지 않아 발생하는 레이스 컨디션 취약점입니다. userdata 항목이 추가되거나 삭제되는 동안 리스트를 순회하면 리스트가 일관되지 않은 상태가 되어 무한 루프에 빠지거나 커널 경고가 발생할 수 있습니다.
💡 쉬운 설명
데이터를 읽고 있는 도중에 누군가 데이터를 삭제하면 컴퓨터가 길을 잃고 무한 반복에 빠지는 현상입니다. 이로 인해 시스템이 멈추거나 오류가 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
netconsole: Acquire su_mutex before navigating configs hierarchy
There is a race between operations that iterate over the userdata
cg_children list and concurrent add/remove of userdata items through
configfs. The update_userdata() function iterates over the
nt->userdata_group.cg_children list, and count_extradata_entries() also
iterates over this same list to count nodes.
Quoting from Documentation/filesystems/configfs.rst:
> A subsystem can navigate the cg_children list and the ci_parent pointer
> to see the tree created by the subsystem. This can race with configfs'
> management of the hierarchy, so configfs uses the subsystem mutex to
> protect modifications. Whenever a subsystem wants to navigate the
> hierarchy, it must do so under the protection of the subsystem
> mutex.
Without proper locking, if a userdata item is added or removed
concurrently while these functions are iterating, the list can be
accessed in an inconsistent state. For example, the list_for_each() loop
can reach a node that is being removed from the list by list_del_init()
which sets the nodes' .next pointer to point to itself, so the loop will
never end (or reach the WARN_ON_ONCE in update_userdata() ).
Fix this by holding the configfs subsystem mutex (su_mutex) during all
operations that iterate over cg_children.
This includes:
- userdatum_value_store() which calls update_userdata() to iterate over
cg_children
- All sysdata_*_enabled_store() functions which call
count_extradata_entries() to iterate over cg_children
The su_mutex must be acquired before dynamic_netconsole_mutex to avoid
potential lock ordering issues, as configfs operations may already hold
su_mutex when calling into our code.
📍 영향받는 시스템
Linux kernel (netconsole 모듈을 사용하는 시스템)
⚔️ 공격 벡터
configfs를 통해 userdata 항목을 동시에 추가하거나 삭제하여 레이스 컨디션을 유발
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 su_mutex 락킹 메커니즘을 적용해야 함
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인