CVE-2024-35917: s390/bpf: Fix bpf_plt pointer arithmetic

Published May 19, 2024
·
Updated

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

s390/bpf: Fix bpfplt pointer arithmetic

Kui-Feng Lee reported a crash on s390x triggered by the dummystops/dummyinitptrarg test [1]:

[<0000000000000002>] 0x2 [<00000000009d5cde>] bpfstructopstestrun+0x156/0x250 [<000000000033145a>] sysbpf+0xa1a/0xd00 [<00000000003319dc>] s390xsysbpf+0x44/0x50 [<0000000000c4382c>] dosyscall+0x244/0x300 [<0000000000c59a40>] systemcall+0x70/0x98

This is caused by GCC moving memcpy() after assignments in bpfjitplt(), resulting in NULL pointers being written instead of the return and the target addresses.

Looking at the GCC internals, the reordering is allowed because the alias analysis thinks that the memcpy() destination and the assignments' left-hand-sides are based on different objects: newplt and bpfpltret/bpfplttarget respectively, and therefore they cannot alias.

This is in turn due to a violation of the C standard:

When two pointers are subtracted, both shall point to elements of the same array object, or one past the last element of the array object ...

From the C's perspective, bpfpltret and bpfplt are distinct objects and cannot be subtracted. In the practical terms, doing so confuses the GCC's alias analysis.

The code was written this way in order to let the C side know a few offsets defined in the assembly. While nice, this is by no means necessary. Fix the noncompliance by hardcoding these offsets.

[1] https://lore.kernel.org/bpf/c9923c1d-971d-4022-8dc8-1364e929d34c@gmail.com/

Affected Software

4 affected componentsFixes available
debian/linux
5.10.223-15.10.234-16.1.129-16.1.135-16.12.25-16.12.27-1
Linux Linux kernel>=6.3<6.6.26
Linux Linux kernel>=6.7<6.8.5
Linux Linux kernel=6.9-rc1

Event History

May 19, 2024
CVE Published
via MITRE·08:35 AM
Data Sourced
via MITRE·08:35 AM
Description
Data Sourced
via NVD·09:15 AM
Description
Data Sourced
via NVD·09:15 AM
RemedySeverityWeaknessAffected Software
Jul 11, 2024
Data Sourced
via Launchpad·07:47 PM
Description
Dec 2, 2024
Data Sourced
via Ubuntu·08:18 PM
RemedyDescriptionSeverityAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2024-35917?

CVE-2024-35917 has a medium severity rating due to its potential to cause system crashes.

2

How do I fix CVE-2024-35917?

To resolve CVE-2024-35917, update the Linux kernel to one of the patched versions: 5.10.223-1, 5.10.226-1, 6.1.123-1, 6.1.119-1, 6.12.11-1, or 6.12.12-1.

3

What types of systems are affected by CVE-2024-35917?

CVE-2024-35917 primarily affects Linux systems running on s390x architecture.

4

What components of the Linux kernel are impacted by CVE-2024-35917?

CVE-2024-35917 specifically affects the BPF (Berkeley Packet Filter) pointer arithmetic inside the Linux kernel.

5

Who reported the vulnerability CVE-2024-35917?

CVE-2024-35917 was reported by Kui-Feng Lee.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203