bpf: sync_linked_regs() must preserve subreg_def
Range propagation must not affect subreg_def marks, otherwise the
following example is rewritten by verifier incorrectly when
BPF_F_TEST_RND_HI32 flag is set:
0: call bpf_ktime_get_ns call bpf_ktime_get_ns
1: r0 &= 0x7fffffff after verifier r0 &= 0x7fffffff
2: w1 = w0 rewrites w1 = w0
3: if w0 < 10 goto +0 --------------> r11 = 0x2f5674a6 (r)
4: r1 >>= 32 r11 <<= 32 (r)
5: r0 = r1 r1 |= r11 (r)
6: exit; if w0 < 0xa goto pc+0
r1 >>= 32
r0 = r1
exit
(or zero extension of w1 at (2) is missing for architectures that
require zero extension for upper register half).
The following happens w/o this patch:
- r0 is marked as not a subreg at (0);
- w1 is marked as subreg at (2);
- w1 subreg_def is overridden at (3) by copy_register_state();
- w1 is read at (5) but mark_insn_zext() does not mark (2)
for zero extension, because w1 subreg_def is not set;
- because of BPF_F_TEST_RND_HI32 flag verifier inserts random
value for hi32 bits of (2) (marked (r));
- this random value is read at (5).
Metrics
Affected Vendors & Products
Source | ID | Title |
---|---|---|
![]() |
DLA-4075-1 | linux security update |
![]() |
DLA-4076-1 | linux-6.1 security update |
![]() |
EUVD-2024-51797 | In the Linux kernel, the following vulnerability has been resolved: bpf: sync_linked_regs() must preserve subreg_def Range propagation must not affect subreg_def marks, otherwise the following example is rewritten by verifier incorrectly when BPF_F_TEST_RND_HI32 flag is set: 0: call bpf_ktime_get_ns call bpf_ktime_get_ns 1: r0 &= 0x7fffffff after verifier r0 &= 0x7fffffff 2: w1 = w0 rewrites w1 = w0 3: if w0 < 10 goto +0 --------------> r11 = 0x2f5674a6 (r) 4: r1 >>= 32 r11 <<= 32 (r) 5: r0 = r1 r1 |= r11 (r) 6: exit; if w0 < 0xa goto pc+0 r1 >>= 32 r0 = r1 exit (or zero extension of w1 at (2) is missing for architectures that require zero extension for upper register half). The following happens w/o this patch: - r0 is marked as not a subreg at (0); - w1 is marked as subreg at (2); - w1 subreg_def is overridden at (3) by copy_register_state(); - w1 is read at (5) but mark_insn_zext() does not mark (2) for zero extension, because w1 subreg_def is not set; - because of BPF_F_TEST_RND_HI32 flag verifier inserts random value for hi32 bits of (2) (marked (r)); - this random value is read at (5). |
![]() |
USN-7276-1 | Linux kernel vulnerabilities |
![]() |
USN-7277-1 | Linux kernel vulnerabilities |
![]() |
USN-7310-1 | Linux kernel vulnerabilities |
![]() |
USN-7387-1 | Linux kernel vulnerabilities |
![]() |
USN-7387-2 | Linux kernel (FIPS) vulnerabilities |
![]() |
USN-7387-3 | Linux kernel (Real-time) vulnerabilities |
![]() |
USN-7388-1 | Linux kernel vulnerabilities |
![]() |
USN-7389-1 | Linux kernel (NVIDIA Tegra) vulnerabilities |
![]() |
USN-7390-1 | Linux kernel (Xilinx ZynqMP) vulnerabilities |
![]() |
USN-7407-1 | Linux kernel (HWE) vulnerabilities |
![]() |
USN-7421-1 | Linux kernel (Azure) vulnerabilities |
![]() |
USN-7458-1 | Linux kernel (IBM) vulnerabilities |
![]() |
USN-7459-1 | Linux kernel (Intel IoTG) vulnerabilities |
![]() |
USN-7459-2 | Linux kernel (GCP) vulnerabilities |
![]() |
USN-7513-1 | Linux kernel vulnerabilities |
![]() |
USN-7513-2 | Linux kernel (Real-time) vulnerabilities |
![]() |
USN-7513-3 | Linux kernel vulnerabilities |
![]() |
USN-7513-4 | Linux kernel (HWE) vulnerabilities |
![]() |
USN-7513-5 | Linux kernel (Oracle) vulnerabilities |
![]() |
USN-7514-1 | Linux kernel (NVIDIA) vulnerabilities |
![]() |
USN-7515-1 | Linux kernel (GKE) vulnerabilities |
![]() |
USN-7515-2 | Linux kernel vulnerabilities |
![]() |
USN-7522-1 | Linux kernel (Azure, N-Series) vulnerabilities |
![]() |
USN-7523-1 | Linux kernel (Raspberry Pi Real-time) vulnerabilities |
![]() |
USN-7524-1 | Linux kernel (Raspberry Pi) vulnerabilities |
Solution
No solution given by the vendor.
Workaround
No workaround given by the vendor.
Wed, 08 Oct 2025 15:15:00 +0000
Type | Values Removed | Values Added |
---|---|---|
Weaknesses | NVD-CWE-noinfo | |
CPEs | cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* cpe:2.3:o:linux:linux_kernel:6.12:rc1:*:*:*:*:*:* cpe:2.3:o:linux:linux_kernel:6.12:rc2:*:*:*:*:*:* cpe:2.3:o:linux:linux_kernel:6.12:rc3:*:*:*:*:*:* |
|
Metrics |
cvssV3_1
|
cvssV3_1
|
Wed, 16 Jul 2025 13:45:00 +0000
Type | Values Removed | Values Added |
---|---|---|
Metrics |
epss
|
epss
|
Tue, 24 Dec 2024 14:30:00 +0000
Type | Values Removed | Values Added |
---|---|---|
Weaknesses | CWE-682 | |
Metrics |
cvssV3_1
|
cvssV3_1
|
Thu, 19 Dec 2024 18:45:00 +0000
Type | Values Removed | Values Added |
---|---|---|
References |
|
Thu, 05 Dec 2024 14:00:00 +0000
Type | Values Removed | Values Added |
---|---|---|
References |
| |
Metrics |
threat_severity
|
cvssV3_1
|
Wed, 04 Dec 2024 14:15:00 +0000
Type | Values Removed | Values Added |
---|---|---|
Description | In the Linux kernel, the following vulnerability has been resolved: bpf: sync_linked_regs() must preserve subreg_def Range propagation must not affect subreg_def marks, otherwise the following example is rewritten by verifier incorrectly when BPF_F_TEST_RND_HI32 flag is set: 0: call bpf_ktime_get_ns call bpf_ktime_get_ns 1: r0 &= 0x7fffffff after verifier r0 &= 0x7fffffff 2: w1 = w0 rewrites w1 = w0 3: if w0 < 10 goto +0 --------------> r11 = 0x2f5674a6 (r) 4: r1 >>= 32 r11 <<= 32 (r) 5: r0 = r1 r1 |= r11 (r) 6: exit; if w0 < 0xa goto pc+0 r1 >>= 32 r0 = r1 exit (or zero extension of w1 at (2) is missing for architectures that require zero extension for upper register half). The following happens w/o this patch: - r0 is marked as not a subreg at (0); - w1 is marked as subreg at (2); - w1 subreg_def is overridden at (3) by copy_register_state(); - w1 is read at (5) but mark_insn_zext() does not mark (2) for zero extension, because w1 subreg_def is not set; - because of BPF_F_TEST_RND_HI32 flag verifier inserts random value for hi32 bits of (2) (marked (r)); - this random value is read at (5). | |
Title | bpf: sync_linked_regs() must preserve subreg_def | |
References |
|

Status: PUBLISHED
Assigner: Linux
Published:
Updated: 2025-05-04T09:53:39.357Z
Reserved: 2024-11-19T17:17:24.995Z
Link: CVE-2024-53125

No data.

Status : Analyzed
Published: 2024-12-04T14:15:20.460
Modified: 2025-10-08T15:00:40.080
Link: CVE-2024-53125


Updated: 2025-07-12T22:44:53Z