CVE-2022-49174

Source
https://nvd.nist.gov/vuln/detail/CVE-2022-49174
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-49174.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2022-49174
Downstream
Related
Published
2025-02-26T01:55:29.590Z
Modified
2025-12-23T20:39:43.341808Z
Summary
ext4: fix ext4_mb_mark_bb() with flex_bg with fast_commit
Details

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

ext4: fix ext4mbmarkbb() with flexbg with fast_commit

In case of flexbg feature (which is by default enabled), extents for any given inode might span across blocks from two different block group. ext4mbmarkbb() only reads the bufferhead of block bitmap once for the starting block group, but it fails to read it again when the extent length boundary overflows to another block group. Then in this below loop it accesses memory beyond the block group bitmap bufferhead and results into a data abort.

for (i = 0; i < clen; i++)
    if (!mb_test_bit(blkoff + i, bitmap_bh->b_data) == !state)
        already++;

This patch adds this functionality for checking block group boundary in ext4mbmarkbb() and update the bufferhead(bitmap_bh) for every different block group.

w/o this patch, I was easily able to hit a data access abort using Power platform.

<...> [ 74.327662] EXT4-fs error (device loop3): ext4mbgeneratebuddy:1141: group 11, block bitmap and bg descriptor inconsistent: 21248 vs 23294 free clusters [ 74.533214] EXT4-fs (loop3): shut down requested (2) [ 74.536705] Aborting journal on device loop3-8. [ 74.702705] BUG: Unable to handle kernel data access on read at 0xc00000005e980000 [ 74.703727] Faulting instruction address: 0xc0000000007bffb8 cpu 0xd: Vector: 300 (Data Access) at [c000000015db7060] pc: c0000000007bffb8: ext4mbmarkbb+0x198/0x5a0 lr: c0000000007bfeec: ext4mbmarkbb+0xcc/0x5a0 sp: c000000015db7300 msr: 800000000280b033 dar: c00000005e980000 dsisr: 40000000 current = 0xc000000027af6880 paca = 0xc00000003ffd5200 irqmask: 0x03 irqhappened: 0x01 pid = 5167, comm = mount <...> enter ? for help [c000000015db7380] c000000000782708 ext4extclearbb+0x378/0x410 [c000000015db7400] c000000000813f14 ext4fcreplay+0x1794/0x2000 [c000000015db7580] c000000000833f7c doonepass+0xe9c/0x12a0 [c000000015db7710] c000000000834504 jbd2journalrecover+0x184/0x2d0 [c000000015db77c0] c000000000841398 jbd2journalload+0x188/0x4a0 [c000000015db7880] c000000000804de8 ext4fillsuper+0x2638/0x3e10 [c000000015db7a40] c0000000005f8404 gettreebdev+0x2b4/0x350 [c000000015db7ae0] c0000000007ef058 ext4gettree+0x28/0x40 [c000000015db7b00] c0000000005f6344 vfsgettree+0x44/0x100 [c000000015db7b70] c00000000063c408 pathmount+0xdd8/0xe70 [c000000015db7c40] c00000000063c8f0 sysmount+0x450/0x550 [c000000015db7d50] c000000000035770 systemcallexception+0x4a0/0x4e0 [c000000015db7e10] c00000000000c74c systemcall_common+0xec/0x250

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/49xxx/CVE-2022-49174.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
8016e29f4362e285f0f7e38fadc61a5b7bdfdfa2
Fixed
cd6d719534af993210306f8a13f9cb3e615f7c8d
Fixed
6a6beb074186a0452368a023a261c7d0eaebe838
Fixed
b07eedd0222e9548ffc568ec429bb1f61d21a39c
Fixed
803fb0e8240cc16585a5c9df76add1dfaa781773
Fixed
bfdc502a4a4c058bf4cbb1df0c297761d528f54d

Affected versions

v5.*

v5.10
v5.10-rc1
v5.10-rc2
v5.10-rc3
v5.10-rc4
v5.10-rc5
v5.10-rc6
v5.10-rc7
v5.10.1
v5.10.10
v5.10.100
v5.10.101
v5.10.102
v5.10.103
v5.10.104
v5.10.105
v5.10.106
v5.10.107
v5.10.108
v5.10.109
v5.10.11
v5.10.12
v5.10.13
v5.10.14
v5.10.15
v5.10.16
v5.10.17
v5.10.18
v5.10.19
v5.10.2
v5.10.20
v5.10.21
v5.10.22
v5.10.23
v5.10.24
v5.10.25
v5.10.26
v5.10.27
v5.10.28
v5.10.29
v5.10.3
v5.10.30
v5.10.31
v5.10.32
v5.10.33
v5.10.34
v5.10.35
v5.10.36
v5.10.37
v5.10.38
v5.10.39
v5.10.4
v5.10.40
v5.10.41
v5.10.42
v5.10.43
v5.10.44
v5.10.45
v5.10.46
v5.10.47
v5.10.48
v5.10.49
v5.10.5
v5.10.50
v5.10.51
v5.10.52
v5.10.53
v5.10.54
v5.10.55
v5.10.56
v5.10.57
v5.10.58
v5.10.59
v5.10.6
v5.10.60
v5.10.61
v5.10.62
v5.10.63
v5.10.64
v5.10.65
v5.10.66
v5.10.67
v5.10.68
v5.10.69
v5.10.7
v5.10.70
v5.10.71
v5.10.72
v5.10.73
v5.10.74
v5.10.75
v5.10.76
v5.10.77
v5.10.78
v5.10.79
v5.10.8
v5.10.80
v5.10.81
v5.10.82
v5.10.83
v5.10.84
v5.10.85
v5.10.86
v5.10.87
v5.10.88
v5.10.89
v5.10.9
v5.10.90
v5.10.91
v5.10.92
v5.10.93
v5.10.94
v5.10.95
v5.10.96
v5.10.97
v5.10.98
v5.10.99
v5.11
v5.11-rc1
v5.11-rc2
v5.11-rc3
v5.11-rc4
v5.11-rc5
v5.11-rc6
v5.11-rc7
v5.12
v5.12-rc1
v5.12-rc1-dontuse
v5.12-rc2
v5.12-rc3
v5.12-rc4
v5.12-rc5
v5.12-rc6
v5.12-rc7
v5.12-rc8
v5.13
v5.13-rc1
v5.13-rc2
v5.13-rc3
v5.13-rc4
v5.13-rc5
v5.13-rc6
v5.13-rc7
v5.14
v5.14-rc1
v5.14-rc2
v5.14-rc3
v5.14-rc4
v5.14-rc5
v5.14-rc6
v5.14-rc7
v5.15
v5.15-rc1
v5.15-rc2
v5.15-rc3
v5.15-rc4
v5.15-rc5
v5.15-rc6
v5.15-rc7
v5.15.1
v5.15.10
v5.15.11
v5.15.12
v5.15.13
v5.15.14
v5.15.15
v5.15.16
v5.15.17
v5.15.18
v5.15.19
v5.15.2
v5.15.20
v5.15.21
v5.15.22
v5.15.23
v5.15.24
v5.15.25
v5.15.26
v5.15.27
v5.15.28
v5.15.29
v5.15.3
v5.15.30
v5.15.31
v5.15.32
v5.15.4
v5.15.5
v5.15.6
v5.15.7
v5.15.8
v5.15.9
v5.16
v5.16-rc1
v5.16-rc2
v5.16-rc3
v5.16-rc4
v5.16-rc5
v5.16-rc6
v5.16-rc7
v5.16-rc8
v5.16.1
v5.16.10
v5.16.11
v5.16.12
v5.16.13
v5.16.14
v5.16.15
v5.16.16
v5.16.17
v5.16.18
v5.16.2
v5.16.3
v5.16.4
v5.16.5
v5.16.6
v5.16.7
v5.16.8
v5.16.9
v5.17
v5.17-rc1
v5.17-rc2
v5.17-rc3
v5.17-rc4
v5.17-rc5
v5.17-rc6
v5.17-rc7
v5.17-rc8
v5.17.1
v5.9
v5.9-rc8

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
5.10.0
Fixed
5.10.110
Type
ECOSYSTEM
Events
Introduced
5.11.0
Fixed
5.15.33
Type
ECOSYSTEM
Events
Introduced
5.16.0
Fixed
5.16.19
Type
ECOSYSTEM
Events
Introduced
5.17.0
Fixed
5.17.2