CVE-2021-47483

See a problem?
Source
https://nvd.nist.gov/vuln/detail/CVE-2021-47483
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-47483.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2021-47483
Related
Published
2024-05-22T09:15:10Z
Modified
2024-09-18T03:17:29.006293Z
Summary
[none]
Details

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

regmap: Fix possible double-free in regcacherbtreeexit()

In regcacherbtreeinserttoblock(), when 'present' realloc failed, the 'blk' which is supposed to assign to 'rbnode->block' will be freed, so 'rbnode->block' points a freed memory, in the error handling path of regcacherbtreeinit(), 'rbnode->block' will be freed again in regcacherbtreeexit(), KASAN will report double-free as follows:

BUG: KASAN: double-free or invalid-free in kfree+0xce/0x390 Call Trace: slabfreefreelisthook+0x10d/0x240 kfree+0xce/0x390 regcacherbtreeexit+0x15d/0x1a0 regcacherbtreeinit+0x224/0x2c0 regcacheinit+0x88d/0x1310 _regmapinit+0x3151/0x4a80 _devmregmapinit+0x7d/0x100 maderaspiprobe+0x10f/0x333 [maderaspi] spiprobe+0x183/0x210 reallyprobe+0x285/0xc30

To fix this, moving up the assignment of rbnode->block to immediately after the reallocation has succeeded so that the data structure stays valid even if the second reallocation fails.

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.84-1

Affected versions

5.*

5.10.46-4
5.10.46-5
5.10.70-1~bpo10+1
5.10.70-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.15.3-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.15.3-1

Ecosystem specific

{
    "urgency": "not yet assigned"
}