CVE-2022-49021

Source
https://nvd.nist.gov/vuln/detail/CVE-2022-49021
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-49021.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2022-49021
Related
Published
2024-10-21T20:15:13Z
Modified
2024-10-24T21:50:22.769484Z
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
[none]
Details

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

net: phy: fix null-ptr-deref while probe() failed

I got a null-ptr-deref report as following when doing fault injection test:

BUG: kernel NULL pointer dereference, address: 0000000000000058 Oops: 0000 [#1] PREEMPT SMP KASAN PTI CPU: 1 PID: 253 Comm: 507-spi-dm9051 Tainted: G B N 6.1.0-rc3+ Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1ubuntu1.1 04/01/2014 RIP: 0010:klistput+0x2d/0xd0 Call Trace: <TASK> klistremove+0xf1/0x1c0 devicereleasedriverinternal+0x23e/0x2d0 busremovedevice+0x1bd/0x240 devicedel+0x357/0x770 phydeviceremove+0x11/0x30 mdiobusunregister+0xa5/0x140 releasenodes+0x6a/0xa0 devresreleaseall+0xf8/0x150 deviceunbindcleanup+0x19/0xd0

//probe path: phydeviceregister() device_add()

phyconnect phyattachdirect() //set device driver probe() //it's failed, driver is not bound devicebind_driver() // probe failed, it's not called

//remove path: phydeviceremove() devicedel() devicereleasedriverinternal() _devicereleasedriver() //dev->drv is not NULL klistremove() <- knode_driver is not added yet, cause null-ptr-deref

In phyattachdirect(), after setting the 'dev->driver', probe() fails, devicebinddriver() is not called, so the knodedriver->nklist is not set, then it causes null-ptr-deref in _devicereleasedriver() while deleting device. Fix this by setting dev->driver to NULL in the error path in phyattach_direct().

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.158-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
5.10.127-1
5.10.127-2~bpo10+1
5.10.127-2
5.10.136-1
5.10.140-1
5.10.148-1
5.10.149-1
5.10.149-2

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
6.0.12-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
6.0.12-1

Ecosystem specific

{
    "urgency": "not yet assigned"
}