🇰🇷 한글 설명
Linux 커널의 eswin 클록 드라이버에서 스택에 할당된 clk_init_data 구조체가 제대로 초기화되지 않는 취약점이 발견되었습니다. 이로 인해 초기화되지 않은 스택의 쓰레기 값이 부모 클록 해상 과정에 영향을 주어 커널이 잘못된 포인터를 참조하게 만듭니다.
💡 쉬운 설명
컴퓨터 메모리의 임시 저장 공간을 깨끗이 비우지 않고 사용하면서, 이전에 남아있던 엉뚱한 데이터가 시스템 명령에 섞여 들어가는 문제입니다. 이로 인해 시스템이 예상치 못한 동작을 하거나 갑자기 멈추는 현상이 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
clk: eswin: Zero-initialize stack-allocated clk_init_data
eswin_clk_register_pll() and eswin_register_clkdiv() declare a struct
clk_init_data on the stack and only initialize some of its fields
(parent_data respectively parent_hws). clk_core_populate_parent_map()
checks parent_names first and parent_data second before falling back
to parent_hws, so leftover stack garbage in the uninitialized fields
hijacks parent resolution and the clk core dereferences a bogus
pointer:
Unable to handle kernel NULL pointer dereference at virtual address 000000000000000c
Oops [#1]
epc : __clk_register+0x31a/0x7f0
[<ffffffff805dc774>] __clk_register+0x31a/0x7f0
[<ffffffff805dcd76>] devm_clk_hw_register+0x2a/0x94
[<ffffffff805e319a>] eswin_register_clkdiv+0x80/0xd0
[<ffffffff805e34a0>] eswin_clk_register_clks+0x162/0x1a0
[<ffffffff805e3736>] eic7700_clk_probe+0x146/0x180
[<ffffffff8065d23c>] platform_probe+0x3c/0x7a
Observed on EIC7700 hardware (with the driver backported to a 6.17
tree); whether the bug triggers depends entirely on what the stack
happens to contain when the registration helpers run.
Zero-initialize both structures.
📍 영향받는 시스템
Linux kernel (EIC7700 하드웨어 및 eswin 클록 드라이버가 포함된 버전)
⚔️ 공격 벡터
스택에 남아있는 이전 데이터(Garbage value)를 이용한 커널 포인터 역참조 유도
🛡️ 대응 방법
eswin_clk_register_pll() 및 eswin_register_clkdiv() 함수 내의 clk_init_data 구조체를 0으로 초기화하는 패치 적용
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인하십시오.