CVE-2024-56615: bpf: fix OOB devmap writes when deleting elements

Published Dec 27, 2024
·
Updated

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

bpf: fix OOB devmap writes when deleting elements

Jordy reported issue against XSKMAP which also applies to DEVMAP - the index used for accessing map entry, due to being a signed integer, causes the OOB writes. Fix is simple as changing the type from int to u32, however, when compared to XSKMAP case, one more thing needs to be addressed.

When map is released from system via devmapfree(), we iterate through all of the entries and an iterator variable is also an int, which implies OOB accesses. Again, change it to be u32.

Example splat below:

[ 160.724676] BUG: unable to handle page fault for address: ffffc8fc2c001000 [ 160.731662] #PF: supervisor read access in kernel mode [ 160.736876] #PF: errorcode(0x0000) - not-present page [ 160.742095] PGD 0 P4D 0 [ 160.744678] Oops: Oops: 0000 [#1] PREEMPT SMP [ 160.749106] CPU: 1 UID: 0 PID: 520 Comm: kworker/u145:12 Not tainted 6.12.0-rc1+ #487 [ 160.757050] Hardware name: Intel Corporation S2600WFT/S2600WFT, BIOS SE5C620.86B.02.01.0008.031920191559 03/19/2019 [ 160.767642] Workqueue: eventsunbound bpfmapfreedeferred [ 160.773308] RIP: 0010:devmapfree+0x77/0x170 [ 160.777735] Code: 00 e8 fd 91 ed ff e8 b8 73 ed ff 41 83 7d 18 19 74 6e 41 8b 45 24 49 8b bd f8 00 00 00 31 db 85 c0 74 48 48 63 c3 48 8d 04 c7 <48> 8b 28 48 85 ed 74 30 48 8b 7d 18 48 85 ff 74 05 e8 b3 52 fa ff [ 160.796777] RSP: 0018:ffffc9000ee1fe38 EFLAGS: 00010202 [ 160.802086] RAX: ffffc8fc2c001000 RBX: 0000000080000000 RCX: 0000000000000024 [ 160.809331] RDX: 0000000000000000 RSI: 0000000000000024 RDI: ffffc9002c001000 [ 160.816576] RBP: 0000000000000000 R08: 0000000000000023 R09: 0000000000000001 [ 160.823823] R10: 0000000000000001 R11: 00000000000ee6b2 R12: dead000000000122 [ 160.831066] R13: ffff88810c928e00 R14: ffff8881002df405 R15: 0000000000000000 [ 160.838310] FS: 0000000000000000(0000) GS:ffff8897e0c40000(0000) knlGS:0000000000000000 [ 160.846528] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 160.852357] CR2: ffffc8fc2c001000 CR3: 0000000005c32006 CR4: 00000000007726f0 [ 160.859604] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 160.866847] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 160.874092] PKRU: 55555554 [ 160.876847] Call Trace: [ 160.879338] <TASK> [ 160.881477] ? die+0x20/0x60 [ 160.884586] ? pagefaultoops+0x15a/0x450 [ 160.888746] ? searchextable+0x22/0x30 [ 160.892647] ? searchbpfextables+0x5f/0x80 [ 160.896988] ? excpagefault+0xa9/0x140 [ 160.900973] ? asmexcpagefault+0x22/0x30 [ 160.905232] ? devmapfree+0x77/0x170 [ 160.909043] ? devmapfree+0x58/0x170 [ 160.912857] bpfmapfreedeferred+0x51/0x90 [ 160.917196] processonework+0x142/0x370 [ 160.921272] workerthread+0x29e/0x3b0 [ 160.925082] ? rescuerthread+0x4b0/0x4b0 [ 160.929157] kthread+0xd4/0x110 [ 160.932355] ? kthreadpark+0x80/0x80 [ 160.936079] retfromfork+0x2d/0x50 [ 160.943396] ? kthreadpark+0x80/0x80 [ 160.950803] retfromforkasm+0x11/0x20 [ 160.958482] </TASK>

Other sources

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

bpf: fix OOB devmap writes when deleting elements

Jordy reported issue against XSKMAP which also applies to DEVMAP - the index used for accessing map entry, due to being a signed integer, causes the OOB writes. Fix is simple as changing the type from int to u32, however, when compared to XSKMAP case, one more thing needs to be addressed.

When map is released from system via devmapfree(), we iterate through all of the entries and an iterator variable is also an int, which implies OOB accesses. Again, change it to be u32.

Example splat below:

[ 160.724676] BUG: unable to handle page fault for address: ffffc8fc2c001000 [ 160.731662] #PF: supervisor read access in kernel mode [ 160.736876] #PF: errorcode(0x0000) - not-present page [ 160.742095] PGD 0 P4D 0 [ 160.744678] Oops: Oops: 0000 [#1] PREEMPT SMP [ 160.749106] CPU: 1 UID: 0 PID: 520 Comm: kworker/u145:12 Not tainted 6.12.0-rc1+ #487 [ 160.757050] Hardware name: Intel Corporation S2600WFT/S2600WFT, BIOS SE5C620.86B.02.01.0008.031920191559 03/19/2019 [ 160.767642] Workqueue: eventsunbound bpfmapfreedeferred [ 160.773308] RIP: 0010:devmapfree+0x77/0x170 [ 160.777735] Code: 00 e8 fd 91 ed ff e8 b8 73 ed ff 41 83 7d 18 19 74 6e 41 8b 45 24 49 8b bd f8 00 00 00 31 db 85 c0 74 48 48 63 c3 48 8d 04 c7 <48> 8b 28 48 85 ed 74 30 48 8b 7d 18 48 85 ff 74 05 e8 b3 52 fa ff [ 160.796777] RSP: 0018:ffffc9000ee1fe38 EFLAGS: 00010202 [ 160.802086] RAX: ffffc8fc2c001000 RBX: 0000000080000000 RCX: 0000000000000024 [ 160.809331] RDX: 0000000000000000 RSI: 0000000000000024 RDI: ffffc9002c001000 [ 160.816576] RBP: 0000000000000000 R08: 0000000000000023 R09: 0000000000000001 [ 160.823823] R10: 0000000000000001 R11: 00000000000ee6b2 R12: dead000000000122 [ 160.831066] R13: ffff88810c928e00 R14: ffff8881002df405 R15: 0000000000000000 [ 160.838310] FS: 0000000000000000(0000) GS:ffff8897e0c40000(0000) knlGS:0000000000000000 [ 160.846528] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 160.852357] CR2: ffffc8fc2c001000 CR3: 0000000005c32006 CR4: 00000000007726f0 [ 160.859604] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 160.866847] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 160.874092] PKRU: 55555554 [ 160.876847] Call Trace: [ 160.879338] <TASK> [ 160.881477] ? die+0x20/0x60 [ 160.884586] ? pagefaultoops+0x15a/0x450 [ 160.888746] ? searchextable+0x22/0x30 [ 160.892647] ? searchbpfextables+0x5f/0x80 [ 160.896988] ? excpagefault+0xa9/0x140 [ 160.900973] ? asmexcpagefault+0x22/0x30 [ 160.905232] ? devmapfree+0x77/0x170 [ 160.909043] ? devmapfree+0x58/0x170 [ 160.912857] bpfmapfreedeferred+0x51/0x90 [ 160.917196] processonework+0x142/0x370 [ 160.921272] workerthread+0x29e/0x3b0 [ 160.925082] ? rescuerthread+0x4b0/0x4b0 [ 160.929157] kthread+0xd4/0x110 [ 160.932355] ? kthreadpark+0x80/0x80 [ 160.936079] retfromfork+0x2d/0x50 [ 160.943396] ? kthreadpark+0x80/0x80 [ 160.950803] retfromforkasm+0x11/0x20 [ 160.958482] </TASK>

NVD

This CVE was automatically created from a reference found in an email or other text. If you are reading this, then this CVE entry is probably erroneous, since this text should be replaced by the official CVE description automatically.

Launchpad

Affected Software

9 affected componentsFixes available
Linux Linux kernel>=4.14<5.4.287
Linux Linux kernel>=5.5<5.10.231
Linux Linux kernel>=5.11<5.15.174
Linux Linux kernel>=5.16<6.1.120
Linux Linux kernel>=6.2<6.6.66
Linux Linux kernel>=6.7<6.12.5
Linux Linux kernel=6.13-rc1
debian/linux<=5.10.223-1
5.10.234-16.1.129-16.1.135-16.12.25-16.12.27-1
debian/linux-6.1
6.1.129-1~deb11u1

Event History

Dec 27, 2024
CVE Published
via MITRE·02:51 PM
Data Sourced
via MITRE·02:51 PM
Description
Data Sourced
via Red Hat·03:05 PM
DescriptionSeverityAffected Software
Data Sourced
via NVD·03:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Mar 31, 2025
Data Sourced
via Launchpad·06:46 PM
Description
May 10, 2025
Data Sourced
via Ubuntu·06:55 PM
RemedyDescriptionSeverityAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2024-56615?

CVE-2024-56615 has a moderate severity level due to the potential for out-of-bounds writes.

2

How do I fix CVE-2024-56615?

To fix CVE-2024-56615, you should update the Linux Kernel to a version that has resolved this vulnerability.

3

What software versions are affected by CVE-2024-56615?

CVE-2024-56615 affects Linux Kernel versions from 4.14 up to 6.12.5, including specific ranges within those versions.

4

What type of vulnerability is CVE-2024-56615?

CVE-2024-56615 is an out-of-bounds write vulnerability in the Linux kernel's BPF subsystem.

5

Who reported CVE-2024-56615?

CVE-2024-56615 was reported by a researcher named Jordy.

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