Skip to content

CVE-2024-50063 bpf: Prevent tail call between progs attached to different hooks

HighCVSS 7.8 EPSS 0.23%
Published
Updated
Exploit status
No public exploit known
CISA SSVC
No known exploitation · automatable: no · technical impact: partial
Technology
Linux KernelUbuntuDebian

Description

In the Linux kernel, the following vulnerability has been resolved:

bpf: Prevent tail call between progs attached to different hooks

bpf progs can be attached to kernel functions, and the attached functions
can take different parameters or return different return values. If
prog attached to one kernel function tail calls prog attached to another
kernel function, the ctx access or return value verification could be
bypassed.

For example, if prog1 is attached to func1 which takes only 1 parameter
and prog2 is attached to func2 which takes two parameters. Since verifier
assumes the bpf ctx passed to prog2 is constructed based on func2's
prototype, verifier allows prog2 to access the second parameter from
the bpf ctx passed to it. The problem is that verifier does not prevent
prog1 from passing its bpf ctx to prog2 via tail call. In this case,
the bpf ctx passed to prog2 is constructed from func1 instead of func2,
that is, the assumption for ctx access verification is bypassed.

Another example, if BPF LSM prog1 is attached to hook file_alloc_security,
and BPF LSM prog2 is attached to hook bpf_lsm_audit_rule_known. Verifier
knows the return value rules for these two hooks, e.g. it is legal for
bpf_lsm_audit_rule_known to return positive number 1, and it is illegal
for file_alloc_security to return positive number. So verifier allows
prog2 to return positive number 1, but does not allow prog1 to return
positive number. The problem is that verifier does not prevent prog1
from calling prog2 via tail call. In this case, prog2's return value 1
will be used as the return value for prog1's hook file_alloc_security.
That is, the return value rule is bypassed.

This patch adds restriction for tail call to prevent such bypasses.

Upgrade path

15 packages: 6 fixed, 8 with no fix yet.

PackageAffectedFixed inStatus
Siemens SIMATIC S7-1500 CPU 1518-4 PN/DP MFP (6ES7518-4AX00-1AB0) >= V3.1.6; >= V3.1.7 No fix listed No fix yet
Siemens SIMATIC S7-1500 CPU 1518-4 PN/DP MFP (6ES7518-4AX00-1AC0) >= V3.1.6; >= V3.1.7 No fix listed No fix yet
Siemens SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP (6ES7518-4FX00-1AB0) >= V3.1.6; >= V3.1.7 No fix listed No fix yet
Siemens SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP (6ES7518-4FX00-1AC0) >= V3.1.6; >= V3.1.7 No fix listed No fix yet
Siemens SIPLUS S7-1500 CPU 1518-4 PN/DP MFP (6AG1518-4AX00-4AC0) >= V3.1.6; >= V3.1.7 No fix listed No fix yet
ubuntu/linux(Ubuntu 22.04) All versions No fix listed No fix yet
ubuntu/linux-kvm(Ubuntu 22.04) All versions No fix listed No fix yet
ubuntu/linux-raspi(Ubuntu 22.04) All versions No fix listed No fix yet
debian/linux(Debian 12) < 6.1.135-1; = 6.1.27-1; = 6.1.37-1; = 6.1.38-1 +34 more 6.1.135-1 Fixed
debian/linux(Debian 13) < 6.11.4-1 6.11.4-1 Fixed
debian/linux(Debian 14) < 6.11.4-1 6.11.4-1 Fixed
Linux kernel < 6.1.135; < 6.6.57; < 6.11.4; < 6.12 +8 more 5d5e3b4cbe8ee16b7bf96fd73a421c92a9da3ca1, 6.1.135, 6.6.57, 6.11.4, 6.12, 28ead3eaabc16ecc907cfb71876da028080f6356, 88c2a10e6c176c2860cd0659f4c0e9d20b3f64d1, d9a807fb7cbfad4328824186e2e4bee28f72169b Fixed
ubuntu/linux(Ubuntu 24.04) < 6.8.0-56.58 6.8.0-56.58 Fixed
ubuntu/linux-raspi(Ubuntu 24.04) < 6.8.0-1028.32 6.8.0-1028.32 Fixed
debian linux = 11.0 No fix listed Versions listed

Affected products

ProductAffected versionsFixed in
debian/linux(Debian:12) < 6.1.135-1 6.1.135-1
debian/linux(Debian:12) = 6.1.106-1 No fix listed
debian/linux(Debian:12) = 6.1.106-2 No fix listed
debian/linux(Debian:12) = 6.1.106-3 No fix listed
debian/linux(Debian:12) = 6.1.112-1 No fix listed
debian/linux(Debian:12) = 6.1.115-1 No fix listed
debian/linux(Debian:12) = 6.1.119-1 No fix listed
debian/linux(Debian:12) = 6.1.123-1 No fix listed
debian/linux(Debian:12) = 6.1.124-1 No fix listed
debian/linux(Debian:12) = 6.1.128-1 No fix listed
debian/linux(Debian:12) = 6.1.129-1 No fix listed
debian/linux(Debian:12) = 6.1.133-1 No fix listed
debian/linux(Debian:12) = 6.1.27-1 No fix listed
debian/linux(Debian:12) = 6.1.37-1 No fix listed
debian/linux(Debian:12) = 6.1.38-1 No fix listed
debian/linux(Debian:12) = 6.1.38-2 No fix listed
debian/linux(Debian:12) = 6.1.38-2~bpo11+1 No fix listed
debian/linux(Debian:12) = 6.1.38-3 No fix listed
debian/linux(Debian:12) = 6.1.38-4 No fix listed
debian/linux(Debian:12) = 6.1.38-4~bpo11+1 No fix listed
debian/linux(Debian:12) = 6.1.52-1 No fix listed
debian/linux(Debian:12) = 6.1.55-1 No fix listed
debian/linux(Debian:12) = 6.1.55-1~bpo11+1 No fix listed
debian/linux(Debian:12) = 6.1.64-1 No fix listed
debian/linux(Debian:12) = 6.1.66-1 No fix listed
Show 43 more
ProductAffected versionsFixed in
debian/linux(Debian:12) = 6.1.67-1 No fix listed
debian/linux(Debian:12) = 6.1.69-1 No fix listed
debian/linux(Debian:12) = 6.1.69-1~bpo11+1 No fix listed
debian/linux(Debian:12) = 6.1.76-1 No fix listed
debian/linux(Debian:12) = 6.1.76-1~bpo11+1 No fix listed
debian/linux(Debian:12) = 6.1.82-1 No fix listed
debian/linux(Debian:12) = 6.1.85-1 No fix listed
debian/linux(Debian:12) = 6.1.90-1 No fix listed
debian/linux(Debian:12) = 6.1.90-1~bpo11+1 No fix listed
debian/linux(Debian:12) = 6.1.94-1 No fix listed
debian/linux(Debian:12) = 6.1.94-1~bpo11+1 No fix listed
debian/linux(Debian:12) = 6.1.98-1 No fix listed
debian/linux(Debian:12) = 6.1.99-1 No fix listed
debian/linux(Debian:13) < 6.11.4-1 6.11.4-1
debian/linux(Debian:14) < 6.11.4-1 6.11.4-1
ubuntu/linux(Ubuntu:22.04) All versions No fix listed
ubuntu/linux-kvm(Ubuntu:22.04) All versions No fix listed
ubuntu/linux-raspi(Ubuntu:22.04) All versions No fix listed
Linux kernel >= f1b9509c2fb0ef4db8d22dac9aef8e856a5d81f6, < d9a807fb7cbfad4328824186e2e4bee28f72169b d9a807fb7cbfad4328824186e2e4bee28f72169b
Linux kernel >= f1b9509c2fb0ef4db8d22dac9aef8e856a5d81f6, < 5d5e3b4cbe8ee16b7bf96fd73a421c92a9da3ca1 5d5e3b4cbe8ee16b7bf96fd73a421c92a9da3ca1
Linux kernel >= f1b9509c2fb0ef4db8d22dac9aef8e856a5d81f6, < 88c2a10e6c176c2860cd0659f4c0e9d20b3f64d1 88c2a10e6c176c2860cd0659f4c0e9d20b3f64d1
Linux kernel >= f1b9509c2fb0ef4db8d22dac9aef8e856a5d81f6, < 28ead3eaabc16ecc907cfb71876da028080f6356 28ead3eaabc16ecc907cfb71876da028080f6356
Linux kernel = 5.5 No fix listed
Linux kernel < 6.1.135 6.1.135
Linux kernel < 6.6.57 6.6.57
Linux kernel < 6.11.4 6.11.4
Linux kernel < 6.12 6.12
Siemens SIMATIC S7-1500 CPU 1518-4 PN/DP MFP (6ES7518-4AX00-1AB0) >= V3.1.6 No fix listed
Siemens SIMATIC S7-1500 CPU 1518-4 PN/DP MFP (6ES7518-4AX00-1AB0) >= V3.1.7 No fix listed
Siemens SIMATIC S7-1500 CPU 1518-4 PN/DP MFP (6ES7518-4AX00-1AC0) >= V3.1.6 No fix listed
Siemens SIMATIC S7-1500 CPU 1518-4 PN/DP MFP (6ES7518-4AX00-1AC0) >= V3.1.7 No fix listed
Siemens SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP (6ES7518-4FX00-1AB0) >= V3.1.6 No fix listed
Siemens SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP (6ES7518-4FX00-1AB0) >= V3.1.7 No fix listed
Siemens SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP (6ES7518-4FX00-1AC0) >= V3.1.6 No fix listed
Siemens SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP (6ES7518-4FX00-1AC0) >= V3.1.7 No fix listed
Siemens SIPLUS S7-1500 CPU 1518-4 PN/DP MFP (6AG1518-4AX00-4AC0) >= V3.1.6 No fix listed
Siemens SIPLUS S7-1500 CPU 1518-4 PN/DP MFP (6AG1518-4AX00-4AC0) >= V3.1.7 No fix listed
ubuntu/linux(Ubuntu:24.04) < 6.8.0-56.58 6.8.0-56.58
ubuntu/linux-raspi(Ubuntu:24.04) < 6.8.0-1028.32 6.8.0-1028.32
debian linux = 11.0 No fix listed
Linux kernel >= 5.5, < 6.1.135 6.1.135
Linux kernel >= 6.2, < 6.6.57 6.6.57
Linux kernel >= 6.7, < 6.11.4 6.11.4

References