🔍 CVE-2025-39767

5.5
CVSS Score
MEDIUM
2025-09-11
2026-10-30 13:18
✅ 완료

🇰🇷 한글 설명

Linux 커널의 LoongArch 아키텍처에서 특정 설정(KASAN, CONFIG_PREEMPT_VOLUNTARY 등)이 활성화된 경우, 모듈 로딩 시 PLT/GOT 계산 알고리즘의 복잡도가 O(n^2)으로 인해 과도한 CPU 점유를 유발하여 소프트 데드락(Soft Deadlock)이 발생할 수 있는 취약점입니다. 이 문제는 재배치 리스트를 정렬하여 알고리즘 복잡도를 O(n log n)으로 최적화함으로써 해결되었습니다.

💡 쉬운 설명

컴퓨터가 새로운 기능을 추가할 때(모듈 로딩), 계산 방식이 너무 느려서 시스템이 일시적으로 멈추거나 응답하지 않는 현상이 발생할 수 있습니다. 계산 과정을 효율적으로 개선하여 시스템이 멈추지 않도록 수정되었습니다.

🇺🇸 원문 (English)

In the Linux kernel, the following vulnerability has been resolved: LoongArch: Optimize module load time by optimizing PLT/GOT counting When enabling CONFIG_KASAN, CONFIG_PREEMPT_VOLUNTARY_BUILD and CONFIG_PREEMPT_VOLUNTARY at the same time, there will be soft deadlock, the relevant logs are as follows: rcu: INFO: rcu_sched self-detected stall on CPU ... Call Trace: [<900000000024f9e4>] show_stack+0x5c/0x180 [<90000000002482f4>] dump_stack_lvl+0x94/0xbc [<9000000000224544>] rcu_dump_cpu_stacks+0x1fc/0x280 [<900000000037ac80>] rcu_sched_clock_irq+0x720/0xf88 [<9000000000396c34>] update_process_times+0xb4/0x150 [<90000000003b2474>] tick_nohz_handler+0xf4/0x250 [<9000000000397e28>] __hrtimer_run_queues+0x1d0/0x428 [<9000000000399b2c>] hrtimer_interrupt+0x214/0x538 [<9000000000253634>] constant_timer_interrupt+0x64/0x80 [<9000000000349938>] __handle_irq_event_percpu+0x78/0x1a0 [<9000000000349a78>] handle_irq_event_percpu+0x18/0x88 [<9000000000354c00>] handle_percpu_irq+0x90/0xf0 [<9000000000348c74>] handle_irq_desc+0x94/0xb8 [<9000000001012b28>] handle_cpu_irq+0x68/0xa0 [<9000000001def8c0>] handle_loongarch_irq+0x30/0x48 [<9000000001def958>] do_vint+0x80/0xd0 [<9000000000268a0c>] kasan_mem_to_shadow.part.0+0x2c/0x2a0 [<90000000006344f4>] __asan_load8+0x4c/0x120 [<900000000025c0d0>] module_frob_arch_sections+0x5c8/0x6b8 [<90000000003895f0>] load_module+0x9e0/0x2958 [<900000000038b770>] __do_sys_init_module+0x208/0x2d0 [<9000000001df0c34>] do_syscall+0x94/0x190 [<900000000024d6fc>] handle_syscall+0xbc/0x158 After analysis, this is because the slow speed of loading the amdgpu module leads to the long time occupation of the cpu and then the soft deadlock. When loading a module, module_frob_arch_sections() tries to figure out the number of PLTs/GOTs that will be needed to handle all the RELAs. It will call the count_max_entries() to find in an out-of-order date which counting algorithm has O(n^2) complexity. To make it faster, we sort the relocation list by info and addend. That way, to check for a duplicate relocation, it just needs to compare with the previous entry. This reduces the complexity of the algorithm to O(n log n), as done in commit d4e0340919fb ("arm64/module: Optimize module load time by optimizing PLT counting"). This gives sinificant reduction in module load time for modules with large number of relocations. After applying this patch, the soft deadlock problem has been solved, and the kernel starts normally without "Call Trace". Using the default configuration to test some modules, the results are as follows: Module Size ip_tables 36K fat 143K radeon 2.5MB amdgpu 16MB Without this patch: Module Module load time (ms) Count(PLTs/GOTs) ip_tables 18 59/6 fat 0 162/14 radeon 54 1221/84 amdgpu 1411 4525/1098 With this patch: Module Module load time (ms) Count(PLTs/GOTs) ip_tables 18 59/6 fat 0 162/14 radeon 22 1221/84 amdgpu 45 4525/1098

📍 영향받는 시스템

LoongArch 아키텍처를 사용하는 Linux 커널 (CONFIG_KASAN, CONFIG_PREEMPT_VOLUNTARY 설정 시)

⚔️ 공격 벡터

로컬 공격자가 대규모 재배치(Relocation)를 포함한 커널 모듈을 로드하여 시스템 데드락 유발 가능

🛡️ 대응 방법

PLT/GOT 계산 최적화 패치가 적용된 최신 Linux 커널로 업데이트

🔧 검증 코드

커널 버전과 함께 KASAN 및 PREEMPT_VOLUNTARY 설정이 활성화되어 있는지 확인합니다.

Shell / Script
uname -a && grep -E 'CONFIG_KASAN|CONFIG_PREEMPT_VOLUNTARY' /boot/config-$(uname -r) 2>/dev/null

📊 CVSS Vector String

CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

💻 영향받는 소프트웨어

Linux Kernel