CVE-2022-49878: bpf, verifier: Fix memory leak in array reallocation for stack state

Published May 1, 2025
·
Updated

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

bpf, verifier: Fix memory leak in array reallocation for stack state

If an error (NULL) is returned by krealloc(), callers of reallocarray() were setting their allocation pointers to NULL, but on error krealloc() does not touch the original allocation. This would result in a memory resource leak. Instead, free the old allocation on the error handling path.

The memory leak information is as follows as also reported by Zhengchao:

unreferenced object 0xffff888019801800 (size 256): comm "bpfrepo", pid 6490, jiffies 4294959200 (age 17.170s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<00000000b211474b>] kmallocnodetrackcaller+0x45/0xc0 [<0000000086712a0b>] krealloc+0x83/0xd0 [<00000000139aab02>] reallocarray+0x82/0xe2 [<00000000b1ca41d1>] growstackstate+0xfb/0x186 [<00000000cd6f36d2>] checkmemaccess.cold+0x141/0x1341 [<0000000081780455>] docheckcommon+0x5358/0xb350 [<0000000015f6b091>] bpfcheck.cold+0xc3/0x29d [<000000002973c690>] bpfprogload+0x13db/0x2240 [<00000000028d1644>] sysbpf+0x1605/0x4ce0 [<00000000053f29bd>] x64sysbpf+0x75/0xb0 [<0000000056fedaf5>] dosyscall64+0x35/0x80 [<000000002bd58261>] entrySYSCALL64afterhwframe+0x63/0xcd

Affected Software

7 affected components
Linux Linux kernel
Linux Linux kernel>=5.14<5.15.79
Linux Linux kernel>=5.16<6.0.9
Linux Linux kernel=6.1-rc1
Linux Linux kernel=6.1-rc2
Linux Linux kernel=6.1-rc3
Linux Linux kernel=6.1-rc4

Event History

May 1, 2025
CVE Published
via MITRE·02:10 PM
Data Sourced
via MITRE·02:10 PM
Description
Data Sourced
via NVD·03:16 PM
RemedyDescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2022-49878?

CVE-2022-49878 has been classified as a medium severity vulnerability in the Linux kernel.

2

How do I fix CVE-2022-49878?

To fix CVE-2022-49878, update your Linux kernel to the latest stable version as provided by your distribution.

3

What does CVE-2022-49878 affect?

CVE-2022-49878 affects the memory handling in the Linux kernel, specifically related to the bpf verifier's array reallocation.

4

Is CVE-2022-49878 exploitable?

CVE-2022-49878 is not directly exploitable but may lead to instability in the system if the underlying issue is not addressed.

5

When was CVE-2022-49878 reported?

CVE-2022-49878 was published as part of the ongoing security updates for the Linux kernel.

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