🇰🇷 한글 설명
리눅스 커널의 arch_topology 구성 요소에서 topology_parse_cpu_capacity() 함수 내 잘못된 오류 검사 로직이 발견되었습니다. PTR_ERR_OR_ZERO() 함수가 유효한 포인터와 NULL 포인터를 모두 0으로 반환하여, NULL 상태에서도 클록 포인터를 사용하려 시도함으로써 NULL 포인터 역참조가 발생할 수 있습니다.
💡 쉬운 설명
컴퓨터의 두뇌 역할을 하는 커널이 부품 정보를 읽어올 때, 정보가 비어있는지 확인하는 과정에서 실수가 있었습니다. 이 실수 때문에 비어있는 정보를 억지로 읽으려다 시스템이 갑자기 멈추거나 오류가 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
arch_topology: Fix incorrect error check in topology_parse_cpu_capacity()
Fix incorrect use of PTR_ERR_OR_ZERO() in topology_parse_cpu_capacity()
which causes the code to proceed with NULL clock pointers. The current
logic uses !PTR_ERR_OR_ZERO(cpu_clk) which evaluates to true for both
valid pointers and NULL, leading to potential NULL pointer dereference
in clk_get_rate().
Per include/linux/err.h documentation, PTR_ERR_OR_ZERO(ptr) returns:
"The error code within @ptr if it is an error pointer; 0 otherwise."
This means PTR_ERR_OR_ZERO() returns 0 for both valid pointers AND NULL
pointers. Therefore !PTR_ERR_OR_ZERO(cpu_clk) evaluates to true (proceed)
when cpu_clk is either valid or NULL, causing clk_get_rate(NULL) to be
called when of_clk_get() returns NULL.
Replace with !IS_ERR_OR_NULL(cpu_clk) which only proceeds for valid
pointers, preventing potential NULL pointer dereference in clk_get_rate().
📍 영향받는 시스템
Linux Kernel (topology_parse_cpu_capacity 함수를 사용하는 아키텍처)
⚔️ 공격 벡터
로컬 시스템에서 특정 하드웨어 토폴로지 구성 시 발생할 수 있는 NULL 포인터 역참조를 통한 서비스 거부(DoS)
🛡️ 대응 방법
PTR_ERR_OR_ZERO() 대신 IS_ERR_OR_NULL()을 사용하도록 커널 패치를 적용하십시오.
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 최신 패치 버전인지 확인하십시오.