{"id":"CVE-2025-39748","summary":"bpf: Forget ranges when refining tnum after JSET","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Forget ranges when refining tnum after JSET\n\nSyzbot reported a kernel warning due to a range invariant violation on\nthe following BPF program.\n\n  0: call bpf_get_netns_cookie\n  1: if r0 == 0 goto \u003cexit\u003e\n  2: if r0 & Oxffffffff goto \u003cexit\u003e\n\nThe issue is on the path where we fall through both jumps.\n\nThat path is unreachable at runtime: after insn 1, we know r0 != 0, but\nwith the sign extension on the jset, we would only fallthrough insn 2\nif r0 == 0. Unfortunately, is_branch_taken() isn't currently able to\nfigure this out, so the verifier walks all branches. The verifier then\nrefines the register bounds using the second condition and we end\nup with inconsistent bounds on this unreachable path:\n\n  1: if r0 == 0 goto \u003cexit\u003e\n    r0: u64=[0x1, 0xffffffffffffffff] var_off=(0, 0xffffffffffffffff)\n  2: if r0 & 0xffffffff goto \u003cexit\u003e\n    r0 before reg_bounds_sync: u64=[0x1, 0xffffffffffffffff] var_off=(0, 0)\n    r0 after reg_bounds_sync:  u64=[0x1, 0] var_off=(0, 0)\n\nImproving the range refinement for JSET to cover all cases is tricky. We\nalso don't expect many users to rely on JSET given LLVM doesn't generate\nthose instructions. So instead of improving the range refinement for\nJSETs, Eduard suggested we forget the ranges whenever we're narrowing\ntnums after a JSET. This patch implements that approach.","modified":"2026-04-02T12:48:08.033812Z","published":"2025-09-11T16:52:20.534Z","related":["SUSE-SU-2025:21074-1","SUSE-SU-2025:21139-1","SUSE-SU-2025:21179-1","SUSE-SU-2026:0962-1","SUSE-SU-2026:1078-1","SUSE-SU-2026:1081-1","SUSE-SU-2026:20667-1","SUSE-SU-2026:20720-1","SUSE-SU-2026:20845-1","SUSE-SU-2026:20876-1","openSUSE-SU-2025:20081-1"],"database_specific":{"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/39xxx/CVE-2025-39748.json","cna_assigner":"Linux"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/0643aa2468192a4d81326e8e76543854870b1ee2"},{"type":"WEB","url":"https://git.kernel.org/stable/c/2fd0c26bacd90ef26522bd3169000a4715bf151f"},{"type":"WEB","url":"https://git.kernel.org/stable/c/591c788d16046edb0220800bf1819554af5853ce"},{"type":"WEB","url":"https://git.kernel.org/stable/c/6279846b9b2532e1b04559ef8bd0dec049f29383"},{"type":"WEB","url":"https://git.kernel.org/stable/c/80a6b11862a7cfdf691e8f9faee89cfea219f098"},{"type":"WEB","url":"https://git.kernel.org/stable/c/f01e06930444cab289a8783017af9b64255bd103"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/39xxx/CVE-2025-39748.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-39748"},{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"960ea056561a08e2b837b2f02d22c53226414a84"},{"fixed":"591c788d16046edb0220800bf1819554af5853ce"},{"fixed":"0643aa2468192a4d81326e8e76543854870b1ee2"},{"fixed":"f01e06930444cab289a8783017af9b64255bd103"},{"fixed":"2fd0c26bacd90ef26522bd3169000a4715bf151f"},{"fixed":"80a6b11862a7cfdf691e8f9faee89cfea219f098"},{"fixed":"6279846b9b2532e1b04559ef8bd0dec049f29383"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-39748.json"}}],"schema_version":"1.7.5"}