CVE-2022-49802

Source
https://nvd.nist.gov/vuln/detail/CVE-2022-49802
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-49802.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2022-49802
Downstream
Related
Published
2025-05-01T14:09:30.308Z
Modified
2025-11-27T02:32:43.144041Z
Summary
ftrace: Fix null pointer dereference in ftrace_add_mod()
Details

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

ftrace: Fix null pointer dereference in ftraceaddmod()

The @ftracemod is allocated by kzalloc(), so both the members {prev,next} of @ftracemode->list are NULL, it's not a valid state to call listdel(). If kstrdup() for @ftracemod->{func|module} fails, it goes to @outfree tag and calls freeftracemod() to destroy @ftracemod, then list_del() will write prev->next and next->prev, where null pointer dereference happens.

BUG: kernel NULL pointer dereference, address: 0000000000000008 Oops: 0002 [#1] PREEMPT SMP NOPTI Call Trace: <TASK> ftracemodcallback+0x20d/0x220 ? dofilpopen+0xd9/0x140 ftraceprocessregex.isra.51+0xbf/0x130 ftraceregexwrite.isra.52.part.53+0x6e/0x90 vfswrite+0xee/0x3a0 ? _auditfilterop+0xb1/0x100 ? auditdtesttask+0x38/0x50 ksyswrite+0xa5/0xe0 dosyscall64+0x3a/0x90 entrySYSCALL64after_hwframe+0x63/0xcd Kernel panic - not syncing: Fatal exception

So call INITLISTHEAD() to initialize the list member to fix this issue.

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/blob/cc431b3424123d84bcd7afd4de150b33f117a8ef/cves/2022/49xxx/CVE-2022-49802.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
673feb9d76ab3eddde7acfd94b206e321cfc90b9
Fixed
665b4c6648bf2b91f69b33817f4321cf4c3cafe9
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
673feb9d76ab3eddde7acfd94b206e321cfc90b9
Fixed
b5bfc61f541d3f092b13dedcfe000d86eb8e133c
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
673feb9d76ab3eddde7acfd94b206e321cfc90b9
Fixed
f715f31559b82e3f75ce047fa476de63d8107584
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
673feb9d76ab3eddde7acfd94b206e321cfc90b9
Fixed
6a14828caddad0d989495a72af678adf60992704
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
673feb9d76ab3eddde7acfd94b206e321cfc90b9
Fixed
1bea037a1abb23a6729bef36a2265a4565f5ea77
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
673feb9d76ab3eddde7acfd94b206e321cfc90b9
Fixed
6e50eb4b1807017f6c2d5089064256ce2de8aef1
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
673feb9d76ab3eddde7acfd94b206e321cfc90b9
Fixed
19ba6c8af9382c4c05dc6a0a79af3013b9a35cd0

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
4.13.0
Fixed
4.14.300
Type
ECOSYSTEM
Events
Introduced
4.15.0
Fixed
4.19.267
Type
ECOSYSTEM
Events
Introduced
4.20.0
Fixed
5.4.225
Type
ECOSYSTEM
Events
Introduced
5.5.0
Fixed
5.10.156
Type
ECOSYSTEM
Events
Introduced
5.11.0
Fixed
5.15.80
Type
ECOSYSTEM
Events
Introduced
5.16.0
Fixed
6.0.10