{"id":"CVE-2025-39767","aliases":["CVE-2025-39767"],"related":[],"kind":"vulnerability","state":"published","title":"LoongArch: Optimize module load time by optimizing PLT/GOT counting","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nLoongArch: Optimize module load time by optimizing PLT/GOT counting\n\nWhen enabling CONFIG_KASAN, CONFIG_PREEMPT_VOLUNTARY_BUILD and\nCONFIG_PREEMPT_VOLUNTARY at the same time, there will be soft deadlock,\nthe relevant logs are as follows:\n\nrcu: INFO: rcu_sched self-detected stall on CPU\n...\nCall Trace:\n[<900000000024f9e4>] show_stack+0x5c/0x180\n[<90000000002482f4>] dump_stack_lvl+0x94/0xbc\n[<9000000000224544>] rcu_dump_cpu_stacks+0x1fc/0x280\n[<900000000037ac80>] rcu_sched_clock_irq+0x720/0xf88\n[<9000000000396c34>] update_process_times+0xb4/0x150\n[<90000000003b2474>] tick_nohz_handler+0xf4/0x250\n[<9000000000397e28>] __hrtimer_run_queues+0x1d0/0x428\n[<9000000000399b2c>] hrtimer_interrupt+0x214/0x538\n[<9000000000253634>] constant_timer_interrupt+0x64/0x80\n[<9000000000349938>] __handle_irq_event_percpu+0x78/0x1a0\n[<9000000000349a78>] handle_irq_event_percpu+0x18/0x88\n[<9000000000354c00>] handle_percpu_irq+0x90/0xf0\n[<9000000000348c74>] handle_irq_desc+0x94/0xb8\n[<9000000001012b28>] handle_cpu_irq+0x68/0xa0\n[<9000000001def8c0>] handle_loongarch_irq+0x30/0x48\n[<9000000001def958>] do_vint+0x80/0xd0\n[<9000000000268a0c>] kasan_mem_to_shadow.part.0+0x2c/0x2a0\n[<90000000006344f4>] __asan_load8+0x4c/0x120\n[<900000000025c0d0>] module_frob_arch_sections+0x5c8/0x6b8\n[<90000000003895f0>] load_module+0x9e0/0x2958\n[<900000000038b770>] __do_sys_init_module+0x208/0x2d0\n[<9000000001df0c34>] do_syscall+0x94/0x190\n[<900000000024d6fc>] handle_syscall+0xbc/0x158\n\nAfter analysis, this is because the slow speed of loading the amdgpu\nmodule leads to the long time occupation of the cpu and then the soft\ndeadlock.\n\nWhen loading a module, module_frob_arch_sections() tries to figure out\nthe number of PLTs/GOTs that will be needed to handle all the RELAs. It\nwill call the count_max_entries() to find in an out-of-order date which\ncounting algorithm has O(n^2) complexity.\n\nTo make it faster, we sort the relocation list by info and addend. That\nway, to check for a duplicate relocation, it just needs to compare with\nthe previous entry. This reduces the complexity of the algorithm to O(n\n log n), as done in commit d4e0340919fb (\"arm64/module: Optimize module\nload time by optimizing PLT counting\"). This gives sinificant reduction\nin module load time for modules with large number of relocations.\n\nAfter applying this patch, the soft deadlock problem has been solved,\nand the kernel starts normally without \"Call Trace\".\n\nUsing the default configuration to test some modules, the results are as\nfollows:\n\nModule              Size\nip_tables           36K\nfat                 143K\nradeon              2.5MB\namdgpu              16MB\n\nWithout this patch:\nModule              Module load time (ms)\tCount(PLTs/GOTs)\nip_tables           18\t\t\t\t59/6\nfat                 0\t\t\t\t162/14\nradeon              54\t\t\t\t1221/84\namdgpu              1411\t\t\t4525/1098\n\nWith this patch:\nModule              Module load time (ms)\tCount(PLTs/GOTs)\nip_tables           18\t\t\t\t59/6\nfat                 0\t\t\t\t162/14\nradeon              22\t\t\t\t1221/84\namdgpu              45\t\t\t\t4525/1098","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nLoongArch: Optimize module load time by optimizing PLT/GOT counting\n\nWhen enabling CONFIG_KASAN, CONFIG_PREEMPT_VOLUNTARY_BUILD and\nCONFIG_PREEMPT_VOLUNTARY at the same time, there will be soft deadlock,\nthe relevant logs are as follows:\n\nrcu: INFO: rcu_sched self-detected stall on CPU\n...\nCall Trace:\n[<900000000024f9e4>] show_stack+0x5c/0x180\n[<90000000002482f4>] dump_stack_lvl+0x94/0xbc\n[<9000000000224544>] rcu_dump_cpu_stacks+0x1fc/0x280\n[<900000000037ac80>] rcu_sched_clock_irq+0x720/0xf88\n[<9000000000396c34>] update_process_times+0xb4/0x150\n[<90000000003b2474>] tick_nohz_handler+0xf4/0x250\n[<9000000000397e28>] __hrtimer_run_queues+0x1d0/0x428\n[<9000000000399b2c>] hrtimer_interrupt+0x214/0x538\n[<9000000000253634>] constant_timer_interrupt+0x64/0x80\n[<9000000000349938>] __handle_irq_event_percpu+0x78/0x1a0\n[<9000000000349a78>] handle_irq_event_percpu+0x18/0x88\n[<9000000000354c00>] handle_percpu_irq+0x90/0xf0\n[<9000000000348c74>] handle_irq_desc+0x94/0xb8\n[<9000000001012b28>] handle_cpu_irq+0x68/0xa0\n[<9000000001def8c0>] handle_loongarch_irq+0x30/0x48\n[<9000000001def958>] do_vint+0x80/0xd0\n[<9000000000268a0c>] kasan_mem_to_shadow.part.0+0x2c/0x2a0\n[<90000000006344f4>] __asan_load8+0x4c/0x120\n[<900000000025c0d0>] module_frob_arch_sections+0x5c8/0x6b8\n[<90000000003895f0>] load_module+0x9e0/0x2958\n[<900000000038b770>] __do_sys_init_module+0x208/0x2d0\n[<9000000001df0c34>] do_syscall+0x94/0x190\n[<900000000024d6fc>] handle_syscall+0xbc/0x158\n\nAfter analysis, this is because the slow speed of loading the amdgpu\nmodule leads to the long time occupation of the cpu and then the soft\ndeadlock.\n\nWhen loading a module, module_frob_arch_sections() tries to figure out\nthe number of PLTs/GOTs that will be needed to handle all the RELAs. It\nwill call the count_max_entries() to find in an out-of-order date which\ncounting algorithm has O(n^2) complexity.\n\nTo make it faster, we sort the relocation list by info and addend. That\nway, to check for a duplicate relocation, it just needs to compare with\nthe previous entry. This reduces the complexity of the algorithm to O(n\n log n), as done in commit d4e0340919fb (\"arm64/module: Optimize module\nload time by optimizing PLT counting\"). This gives sinificant reduction\nin module load time for modules with large number of relocations.\n\nAfter applying this patch, the soft deadlock problem has been solved,\nand the kernel starts normally without \"Call Trace\".\n\nUsing the default configuration to test some modules, the results are as\nfollows:\n\nModule              Size\nip_tables           36K\nfat                 143K\nradeon              2.5MB\namdgpu              16MB\n\nWithout this patch:\nModule              Module load time (ms)\tCount(PLTs/GOTs)\nip_tables           18\t\t\t\t59/6\nfat                 0\t\t\t\t162/14\nradeon              54\t\t\t\t1221/84\namdgpu              1411\t\t\t4525/1098\n\nWith this patch:\nModule              Module load time (ms)\tCount(PLTs/GOTs)\nip_tables           18\t\t\t\t59/6\nfat                 0\t\t\t\t162/14\nradeon              22\t\t\t\t1221/84\namdgpu              45\t\t\t\t4525/1098","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\nLoongArch: Optimizar el tiempo de carga del módulo optimizando el conteo de PLT/GOT\n\nAl habilitar CONFIG_KASAN, CONFIG_PREEMPT_VOLUNTARY_BUILD y CONFIG_PREEMPT_VOLUNTARY al mismo tiempo, habrá un interbloqueo suave, los registros relevantes son los siguientes:\n\nrcu: INFO: rcu_sched detectó un bloqueo en la CPU\n...\nTraza de Llamada:\n[<900000000024f9e4>] show_stack+0x5c/0x180\n[<90000000002482f4>] dump_stack_lvl+0x94/0xbc\n[<9000000000224544>] rcu_dump_cpu_stacks+0x1fc/0x280\n[<900000000037ac80>] rcu_sched_clock_irq+0x720/0xf88\n[<9000000000396c34>] update_process_times+0xb4/0x150\n[<90000000003b2474>] tick_nohz_handler+0xf4/0x250\n[<9000000000397e28>] __hrtimer_run_queues+0x1d0/0x428\n[<9000000000399b2c>] hrtimer_interrupt+0x214/0x538\n[<9000000000253634>] constant_timer_interrupt+0x64/0x80\n[<9000000000349938>] __handle_irq_event_percpu+0x78/0x1a0\n[<9000000000349a78>] handle_irq_event_percpu+0x18/0x88\n[<9000000000354c00>] handle_percpu_irq+0x90/0xf0\n[<9000000000348c74>] handle_irq_desc+0x94/0xb8\n[<9000000001012b28>] handle_cpu_irq+0x68/0xa0\n[<9000000001def8c0>] handle_loongarch_irq+0x30/0x48\n[<9000000001def958>] do_vint+0x80/0xd0\n[<9000000000268a0c>] kasan_mem_to_shadow.part.0+0x2c/0x2a0\n[<90000000006344f4>] __asan_load8+0x4c/0x120\n[<900000000025c0d0>] module_frob_arch_sections+0x5c8/0x6b8\n[<90000000003895f0>] load_module+0x9e0/0x2958\n[<900000000038b770>] __do_sys_init_module+0x208/0x2d0\n[<9000000001df0c34>] do_syscall+0x94/0x190\n[<900000000024d6fc>] handle_syscall+0xbc/0x158\n\nDespués del análisis, esto se debe a que la lenta velocidad de carga del módulo amdgpu conduce a la ocupación prolongada de la CPU y luego al interbloqueo suave.\n\nAl cargar un módulo, module_frob_arch_sections() intenta determinar el número de PLT/GOT que serán necesarios para manejar todas las RELA. Llamará a count_max_entries() para encontrar en datos desordenados qué algoritmo de conteo tiene una complejidad O(n^2).\n\nPara hacerlo más rápido, ordenamos la lista de reubicación por información y adendo. De esa manera, para verificar una reubicación duplicada, solo necesita comparar con la entrada anterior. Esto reduce la complejidad del algoritmo a O(n log n), como se hizo en el commit d4e0340919fb ('arm64/module: Optimizar el tiempo de carga del módulo optimizando el conteo de PLT'). Esto proporciona una reducción significativa en el tiempo de carga del módulo para módulos con un gran número de reubicaciones.\n\nDespués de aplicar este parche, el problema del interbloqueo suave ha sido resuelto, y el kernel se inicia normalmente sin 'Traza de Llamada'.\n\nUsando la configuración predeterminada para probar algunos módulos, los resultados son los siguientes:\n\nMódulo              Tamaño\nip_tables           36K\nfat                 143K\nradeon              2.5MB\namdgpu              16MB\n\nSin este parche:\nMódulo              Tiempo de carga del módulo (ms)\tConteo(PLTs/GOTs)\nip_tables           18\t\t\t\t59/6\nfat                 0\t\t\t\t162/14\nradeon              54\t\t\t\t1221/84\namdgpu              1411\t\t\t4525/1098\n\nCon este parche:\nMódulo              Tiempo de carga del módulo (ms)\tConteo(PLTs/GOTs)\nip_tables           18\t\t\t\t59/6\nfat                 0\t\t\t\t162/14\nradeon              22\t\t\t\t1221/84\namdgpu              45\t\t\t\t4525/1098","source":"nvd"}],"published":"2025-09-11T16:56:22.238Z","modified":"2026-10-30T13:18:09.397Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"},"severities":[{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"}],"cwes":["CWE-667"],"affected":[{"ranges":[{"type":"git","introduced":"fcdfe9d22bed08409968a751e93112f742208be6","fixed":"45b4617608304119fa4da338ae2c7823982d00f6","status":"affected"},{"type":"git","introduced":"fcdfe9d22bed08409968a751e93112f742208be6","fixed":"5189c0b7c251363a4dd7678ed11b054c54f36f6f","status":"affected"},{"type":"git","introduced":"fcdfe9d22bed08409968a751e93112f742208be6","fixed":"e94cdb9fb279430cbd323a74c7ec124c85109747","status":"affected"},{"type":"git","introduced":"fcdfe9d22bed08409968a751e93112f742208be6","fixed":"a096b0280168d0c8b0ec1cbbfd56c8b81af8c7d8","status":"affected"},{"type":"git","introduced":"fcdfe9d22bed08409968a751e93112f742208be6","fixed":"63dbd8fb2af3a89466538599a9acb2d11ef65c06","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"5.19","status":"affected"},{"type":"semver","introduced":"0","fixed":"5.19","status":"unaffected"},{"type":"semver","introduced":"6.1.191","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.103","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.44","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.16.4","lastAffected":"6.16.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.17","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"5.19","fixed":"6.6.103"},{"status":"affected","introduced":"6.7","fixed":"6.12.44"},{"status":"affected","introduced":"6.13","fixed":"6.16.4"},{"status":"affected","version":"6.17"},{"status":"affected","version":"6.17"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/45b4617608304119fa4da338ae2c7823982d00f6","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/5189c0b7c251363a4dd7678ed11b054c54f36f6f","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/e94cdb9fb279430cbd323a74c7ec124c85109747","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/a096b0280168d0c8b0ec1cbbfd56c8b81af8c7d8","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/63dbd8fb2af3a89466538599a9acb2d11ef65c06","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-39767","url":"https://www.cve.org/CVERecord?id=CVE-2025-39767","licence":"CVE Terms of Use","modified":"2026-10-30T12:22:26.759Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-39767","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-39767","licence":"Public domain","modified":"2026-10-30T13:18:09.397Z"}],"updatedAt":"2026-11-25T22:59:04.556Z","epss":{"score":0.00121,"percentile":0.02111,"date":"2026-12-01T12:00:22.000Z"}}