CVE-2025-21857

Source
https://cve.org/CVERecord?id=CVE-2025-21857
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-21857.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2025-21857
Downstream
Related
Published
2025-03-12T09:42:10.622Z
Modified
2026-03-12T02:14:43.777836Z
Severity
  • 5.5 (Medium) CVSS_V3 - CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
Summary
net/sched: cls_api: fix error handling causing NULL dereference
Details

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

net/sched: cls_api: fix error handling causing NULL dereference

tcfextsmisscookiebasealloc() calls xaalloccyclic() which can return 1 if the allocation succeeded after wrapping. This was treated as an error, with value 1 returned to caller tcfextsinitex() which sets exts->actions to NULL and returns 1 to caller fl_change().

flchange() treats err == 1 as success, calling tcfextsvalidateex() which calls tcfactioninit() with exts->actions as argument, where it is dereferenced.

Example trace:

BUG: kernel NULL pointer dereference, address: 0000000000000000 CPU: 114 PID: 16151 Comm: handler114 Kdump: loaded Not tainted 5.14.0-503.16.1.el95.x8664 #1 RIP: 0010:tcfactioninit+0x1f8/0x2c0 Call Trace: tcfactioninit+0x1f8/0x2c0 tcfextsvalidateex+0x175/0x190 flchange+0x537/0x1120 [cls_flower]

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/21xxx/CVE-2025-21857.json"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
80cd22c35c9001fe72bf614d29439de41933deca
Fixed
de4b679aa3b4da7ec34f639df068b914f20e3c3c
Fixed
3e4c56cf41876ef2a82f0877fe2a67648f8632b8
Fixed
3c74b5787caf59bb1e9c5fe0a360643a71eb1e8a
Fixed
071ed42cff4fcdd89025d966d48eabef59913bf2

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-21857.json"