🇰🇷 한글 설명
Linux 커널의 OPP(Operating Performance Points) 추가 과정에서 발생하는 레이스 컨디션 취약점입니다. 새로운 OPP가 리스트에 추가된 후 참조 횟수(kref)가 초기화되기 전에 다른 프로세스가 이를 조회할 경우, 참조 횟수 손상 및 조기 메모리 해제가 발생할 수 있습니다.
💡 쉬운 설명
새로운 장치 설정값이 시스템에 등록되는 도중에 다른 프로그램이 이를 동시에 읽으려고 시도할 때 발생하는 오류입니다. 이 과정에서 데이터가 꼬여 시스템이 예기치 않게 종료되거나 메모리 오류가 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
OPP: Fix race between OPP addition and lookup
A race exists between dev_pm_opp_add_dynamic() and
dev_pm_opp_find_freq_exact():
CPU0 (add) CPU1 (lookup)
------------------------------- ------------------------------
_opp_add()
mutex_lock()
list_add(&new_opp->node, head)
mutex_unlock() _opp_table_find_key()
mutex_lock()
dev_pm_opp_get(opp)
kref_get()
mutex_unlock()
kref_init(&new_opp->kref)
dev_pm_opp_put()
kref_put_mutex()
The newly added OPP is inserted into the list before its kref is
initialized. A concurrent lookup can find this OPP and increment its
reference count while it is still uninitialized, leading to refcount
corruption and a potential premature free.
Fix this by initializing ->kref and ->opp_table before making the OPP
visible via list_add(). This ensures any concurrent lookup observes a
fully initialized object.
[ Viresh: Updated commit log ]
📍 영향받는 시스템
Linux Kernel (OPP 관련 기능이 포함된 모든 버전)
⚔️ 공격 벡터
동시성 제어 미흡을 이용한 레이스 컨디션 유도 (Local/Remote)
🛡️ 대응 방법
커널 패치를 적용하여 OPP 객체가 리스트에 노출되기 전 kref 및 opp_table을 먼저 초기화하도록 업데이트해야 합니다.
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 해결된 패치 버전인지 확인합니다.