CVE-2025-38489: s390/bpf: Fix bpf_arch_text_poke() with new_addr == NULL again
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
s390/bpf: Fix bpf_arch_text_poke() with new_addr == NULL again
Commit 7ded842b356d ("s390/bpf: Fix bpf_plt pointer arithmetic") has accidentally removed the critical piece of commit c730fce7c70c ("s390/bpf: Fix bpf_arch_text_poke() with new_addr == NULL"), causing intermittent kernel panics in e.g. perf's on_switch() prog to reappear.
Restore the fix and add a comment.
The Linux kernel CVE team has assigned CVE-2025-38489 to this issue.
Affected and fixed versions
===========================
Issue introduced in 6.6.26 with commit c3062bdb859b6e2567e7f5c8cde20c0250bb130f and fixed in 6.6.100 with commit 0c7b20f7785cfdd59403333612c90b458b12307c Issue introduced in 6.9 with commit 7ded842b356d151ece8ac4985940438e6d3998bb and fixed in 6.12.40 with commit d5629d1af0600f8cc7c9245e8d832a66358ef889 Issue introduced in 6.9 with commit 7ded842b356d151ece8ac4985940438e6d3998bb and fixed in 6.15.8 with commit a4f9c7846b1ac428921ce9676b1b8c80ed60093c Issue introduced in 6.9 with commit 7ded842b356d151ece8ac4985940438e6d3998bb and fixed in 6.16 with commit 6a5abf8cf182f577c7ae6c62f14debc9754ec986 Issue introduced in 6.8.5 with commit d3d74e45a060d218fe4b0c9174f0a77517509d8e
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2025-38489
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
arch/s390/net/bpf_jit_comp.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/0c7b20f7785cfdd59403333612c90b458b12307c https://git.kernel.org/stable/c/d5629d1af0600f8cc7c9245e8d832a66358ef889 https://git.kernel.org/stable/c/a4f9c7846b1ac428921ce9676b1b8c80ed60093c https://git.kernel.org/stable/c/6a5abf8cf182f577c7ae6c62f14debc9754ec986