CVE-2022-49674

Source
https://nvd.nist.gov/vuln/detail/CVE-2022-49674
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-49674.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2022-49674
Downstream
Related
Published
2025-02-26T02:24:06.636Z
Modified
2025-11-28T02:34:53.527821Z
Summary
dm raid: fix accesses beyond end of raid member array
Details

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

dm raid: fix accesses beyond end of raid member array

On dm-raid table load (using raidctr), dm-raid allocates an array rs->devs[rs->raiddisks] for the raid device members. rs->raid_disks is defined by the number of raid metadata and image tupples passed into the target's constructor.

In the case of RAID layout changes being requested, that number can be different from the current number of members for existing raid sets as defined in their superblocks. Example RAID layout changes include: - raid1 legs being added/removed - raid4/5/6/10 number of stripes changed (stripe reshaping) - takeover to higher raid level (e.g. raid5 -> raid6)

When accessing array members, rs->raiddisks must be used in control loops instead of the potentially larger value in rs->md.raiddisks. Otherwise it will cause memory access beyond the end of the rs->devs array.

Fix this by changing code that is prone to out-of-bounds access. Also fix validateraidredundancy() to validate all devices that are added. Also, use braces to help clean up raiditeratedevices().

The out-of-bounds memory accesses was discovered using KASAN.

This commit was verified to pass all LVM2 RAID tests (with KASAN enabled).

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/49xxx/CVE-2022-49674.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
1da177e4c3f41524e886b7f1b8a0c1fc7321cac2
Fixed
5e161a8826b63c0b8b43e4a7fad1f956780f42ab
Fixed
df1a5ab0dd0775f2ea101c71f2addbc4c0ea0f85
Fixed
90de15357504c8097ab29769dc6852e16281e9e8
Fixed
9bf2b0757b04c78dc5d6e3a198acca98457b32a1
Fixed
6352b2f4d8e95ec0ae576d7705435d64cfa29503
Fixed
bcff98500ea3b4e7615ec31d2bdd326bc1ef5134
Fixed
332bd0778775d0cf105c4b9e03e460b590749916

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
4.14.287
Type
ECOSYSTEM
Events
Introduced
4.15.0
Fixed
4.19.251
Type
ECOSYSTEM
Events
Introduced
4.20.0
Fixed
5.4.204
Type
ECOSYSTEM
Events
Introduced
5.5.0
Fixed
5.10.129
Type
ECOSYSTEM
Events
Introduced
5.11.0
Fixed
5.15.53
Type
ECOSYSTEM
Events
Introduced
5.16.0
Fixed
5.18.10