CVE-2022-49505

Source
https://nvd.nist.gov/vuln/detail/CVE-2022-49505
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-49505.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2022-49505
Related
Published
2025-02-26T07:01:26Z
Modified
2025-02-27T18:41:10.513540Z
Summary
[none]
Details

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

NFC: NULL out the dev->rfkill to prevent UAF

Commit 3e3b5dfcd16a ("NFC: reorder the logic in nfc{un,}registerdevice") assumes the deviceisregistered() in function nfcdevup() will help to check when the rfkill is unregistered. However, this check only take effect when devicedel(&dev->dev) is done in nfcunregister_device(). Hence, the rfkill object is still possible be dereferenced.

The crash trace in latest kernel (5.18-rc2):

[ 68.760105] ================================================================== [ 68.760330] BUG: KASAN: use-after-free in _lockacquire+0x3ec1/0x6750 [ 68.760756] Read of size 8 at addr ffff888009c93018 by task fuzz/313 [ 68.760756] [ 68.760756] CPU: 0 PID: 313 Comm: fuzz Not tainted 5.18.0-rc2 #4 [ 68.760756] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 [ 68.760756] Call Trace: [ 68.760756] <TASK> [ 68.760756] dumpstacklvl+0x57/0x7d [ 68.760756] printreport.cold+0x5e/0x5db [ 68.760756] ? _lockacquire+0x3ec1/0x6750 [ 68.760756] kasanreport+0xbe/0x1c0 [ 68.760756] ? _lockacquire+0x3ec1/0x6750 [ 68.760756] _lockacquire+0x3ec1/0x6750 [ 68.760756] ? lockdephardirqsonprepare+0x410/0x410 [ 68.760756] ? registerlockclass+0x18d0/0x18d0 [ 68.760756] lockacquire+0x1ac/0x4f0 [ 68.760756] ? rfkillblocked+0xe/0x60 [ 68.760756] ? lockdephardirqsonprepare+0x410/0x410 [ 68.760756] ? mutexlockionested+0x12c0/0x12c0 [ 68.760756] ? nlagetrangesigned+0x540/0x540 [ 68.760756] ? rawspinlockirqsave+0x4e/0x50 [ 68.760756] rawspinlockirqsave+0x39/0x50 [ 68.760756] ? rfkillblocked+0xe/0x60 [ 68.760756] rfkillblocked+0xe/0x60 [ 68.760756] nfcdevup+0x84/0x260 [ 68.760756] nfcgenldevup+0x90/0xe0 [ 68.760756] genlfamilyrcvmsgdoit+0x1f4/0x2f0 [ 68.760756] ? genlfamilyrcvmsgattrsparse.constprop.0+0x230/0x230 [ 68.760756] ? securitycapable+0x51/0x90 [ 68.760756] genlrcvmsg+0x280/0x500 [ 68.760756] ? genlgetcmd+0x3c0/0x3c0 [ 68.760756] ? lockacquire+0x1ac/0x4f0 [ 68.760756] ? nfcgenldevdown+0xe0/0xe0 [ 68.760756] ? lockdephardirqsonprepare+0x410/0x410 [ 68.760756] netlinkrcvskb+0x11b/0x340 [ 68.760756] ? genlgetcmd+0x3c0/0x3c0 [ 68.760756] ? netlinkack+0x9c0/0x9c0 [ 68.760756] ? netlinkdelivertap+0x136/0xb00 [ 68.760756] genlrcv+0x1f/0x30 [ 68.760756] netlinkunicast+0x430/0x710 [ 68.760756] ? memset+0x20/0x40 [ 68.760756] ? netlinkattachskb+0x740/0x740 [ 68.760756] ? _buildskbaround+0x1f4/0x2a0 [ 68.760756] netlinksendmsg+0x75d/0xc00 [ 68.760756] ? netlinkunicast+0x710/0x710 [ 68.760756] ? netlinkunicast+0x710/0x710 [ 68.760756] socksendmsg+0xdf/0x110 [ 68.760756] _syssendto+0x19e/0x270 [ 68.760756] ? _ia32sysgetpeername+0xa0/0xa0 [ 68.760756] ? fdinstall+0x178/0x4c0 [ 68.760756] ? fdinstall+0x195/0x4c0 [ 68.760756] ? kernelfpubeginmask+0x1c0/0x1c0 [ 68.760756] _x64syssendto+0xd8/0x1b0 [ 68.760756] ? lockdephardirqson+0xbf/0x130 [ 68.760756] ? syscallenterfromusermode+0x1d/0x50 [ 68.760756] dosyscall64+0x3b/0x90 [ 68.760756] entrySYSCALL64afterhwframe+0x44/0xae [ 68.760756] RIP: 0033:0x7f67fb50e6b3 ... [ 68.760756] RSP: 002b:00007f67fa91fe90 EFLAGS: 00000293 ORIG_RAX: 000000000000002c [ 68.760756] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f67fb50e6b3 [ 68.760756] RDX: 000000000000001c RSI: 0000559354603090 RDI: 0000000000000003 [ 68.760756] RBP: 00007f67fa91ff00 R08: 00007f67fa91fedc R09: 000000000000000c [ 68.760756] R10: 0000000000000000 R11: 0000000000000293 R12: 00007ffe824d496e [ 68.760756] R13: 00007ffe824d496f R14: 00007f67fa120000 R15: 0000000000000003

[ 68.760756] </TASK> [ 68.760756] [ 68.760756] Allocated by task 279: [ 68.760756] kasansavestack+0x1e/0x40 [ ---truncated---

References

Affected packages

Debian:11 / linux

Package

Name
linux
Purl
pkg:deb/debian/linux?arch=source

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
5.10.127-1

Affected versions

5.*

5.10.46-4
5.10.46-5
5.10.70-1~bpo10+1
5.10.70-1
5.10.84-1
5.10.92-1~bpo10+1
5.10.92-1
5.10.92-2
5.10.103-1~bpo10+1
5.10.103-1
5.10.106-1
5.10.113-1
5.10.120-1~bpo10+1
5.10.120-1

Ecosystem specific

{
    "urgency": "not yet assigned"
}

Debian:12 / linux

Package

Name
linux
Purl
pkg:deb/debian/linux?arch=source

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
5.18.5-1

Ecosystem specific

{
    "urgency": "not yet assigned"
}

Debian:13 / linux

Package

Name
linux
Purl
pkg:deb/debian/linux?arch=source

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
5.18.5-1

Ecosystem specific

{
    "urgency": "not yet assigned"
}