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-01T15:16:03Z
Modified
2025-08-09T20:01:26Z
Summary
[none]
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.

References

Affected packages