# CVE-2023-53143: ext4: fix another off-by-one fsmap error on 1k block filesystems

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.29% (percentile 14, 2026-11-26)
- **CWE:** CWE-193
- **Published:** 2025-05-02T15:56:13.656Z
- **Modified:** 2026-06-17T06:44:22.710Z

## Who should check

- Anyone running Linux \>= 4a4956249dac0b9b0027949907bff0cd1a9b57fa, \< a70b49dc7eee5dbe3775a650ce598e3557ff5475; \>= 4a4956249dac0b9b0027949907bff0cd1a9b57fa, \< f16054ac1774915160ca4e1c73ff7a269465a1b9; \>= 4a4956249dac0b9b0027949907bff0cd1a9b57fa, \< c24f838493792b5e78a3596b4ca96375aa0af4c2; \>= 4a4956249dac0b9b0027949907bff0cd1a9b57fa, \< 1d2366624b4c19a2ba6baf67fe57f4a1b0f67c05; \>= 4a4956249dac0b9b0027949907bff0cd1a9b57fa, \< c5d7c31e17224d847a330180ec1b03bf390632b2; \>= 4a4956249dac0b9b0027949907bff0cd1a9b57fa, \< eb3a695aa71a514f2e7f5778e05faba3733b70a0; \>= 4a4956249dac0b9b0027949907bff0cd1a9b57fa, \< 15ebade3266b300da9cd1edce4004fe8fd6a2b88; \>= 4a4956249dac0b9b0027949907bff0cd1a9b57fa, \< c993799baf9c5861f8df91beb80e1611b12efcbd
- Anyone running Linux 4.13

## Description

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

ext4: fix another off-by-one fsmap error on 1k block filesystems

Apparently syzbot figured out that issuing this FSMAP call:

struct fsmap\_head cmd = {
	.fmh\_count	= ...;
	.fmh\_keys	= {
		{ .fmr\_device = /\* ext4 dev \*/, .fmr\_physical = 0, },
		{ .fmr\_device = /\* ext4 dev \*/, .fmr\_physical = 0, },
	},
...
};
ret = ioctl(fd, FS\_IOC\_GETFSMAP, &cmd);

Produces this crash if the underlying filesystem is a 1k-block ext4
filesystem:

kernel BUG at fs/ext4/ext4.h:3331!
invalid opcode: 0000 \[\#1\] PREEMPT SMP
CPU: 3 PID: 3227965 Comm: xfs\_io Tainted: G        W  O       6.2.0-rc8-achx
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.15.0-1 04/01/2014
RIP: 0010:ext4\_mb\_load\_buddy\_gfp+0x47c/0x570 \[ext4\]
RSP: 0018:ffffc90007c03998 EFLAGS: 00010246
RAX: ffff888004978000 RBX: ffffc90007c03a20 RCX: ffff888041618000
RDX: 0000000000000000 RSI: 00000000000005a4 RDI: ffffffffa0c99b11
RBP: ffff888012330000 R08: ffffffffa0c2b7d0 R09: 0000000000000400
R10: ffffc90007c03950 R11: 0000000000000000 R12: 0000000000000001
R13: 00000000ffffffff R14: 0000000000000c40 R15: ffff88802678c398
FS:  00007fdf2020c880(0000) GS:ffff88807e100000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ffd318a5fe8 CR3: 000000007f80f001 CR4: 00000000001706e0
Call Trace:
 \<TASK\>
 ext4\_mballoc\_query\_range+0x4b/0x210 \[ext4 dfa189daddffe8fecd3cdfd00564e0f265a8ab80\]
 ext4\_getfsmap\_datadev+0x713/0x890 \[ext4 dfa189daddffe8fecd3cdfd00564e0f265a8ab80\]
 ext4\_getfsmap+0x2b7/0x330 \[ext4 dfa189daddffe8fecd3cdfd00564e0f265a8ab80\]
 ext4\_ioc\_getfsmap+0x153/0x2b0 \[ext4 dfa189daddffe8fecd3cdfd00564e0f265a8ab80\]
 \_\_ext4\_ioctl+0x2a7/0x17e0 \[ext4 dfa189daddffe8fecd3cdfd00564e0f265a8ab80\]
 \_\_x64\_sys\_ioctl+0x82/0xa0
 do\_syscall\_64+0x2b/0x80
 entry\_SYSCALL\_64\_after\_hwframe+0x46/0xb0
RIP: 0033:0x7fdf20558aff
RSP: 002b:00007ffd318a9e30 EFLAGS: 00000246 ORIG\_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00000000000200c0 RCX: 00007fdf20558aff
RDX: 00007fdf1feb2010 RSI: 00000000c0c0583b RDI: 0000000000000003
RBP: 00005625c0634be0 R08: 00005625c0634c40 R09: 0000000000000001
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fdf1feb2010
R13: 00005625be70d994 R14: 0000000000000800 R15: 0000000000000000

For GETFSMAP calls, the caller selects a physical block device by
writing its block number into fsmap\_head.fmh\_keys\[01\].fmr\_device.
To query mappings for a subrange of the device, the starting byte of the
range is written to fsmap\_head.fmh\_keys\[0\].fmr\_physical and the last
byte of the range goes in fsmap\_head.fmh\_keys\[1\].fmr\_physical.

IOWs, to query what mappings overlap with bytes 3-14 of /dev/sda, you'd
set the inputs as follows:

	fmh\_keys\[0\] = { .fmr\_device = major(8, 0), .fmr\_physical = 3},
	fmh\_keys\[1\] = { .fmr\_device = major(8, 0), .fmr\_physical = 14},

Which would return you whatever is mapped in the 12 bytes starting at
physical offset 3.

The crash is due to insufficient range validation of keys\[1\] in
ext4\_getfsmap\_datadev.  On 1k-block filesystems, block 0 is not part of
the filesystem, which means that s\_first\_data\_block is nonzero.
ext4\_get\_group\_no\_and\_offset subtracts this quantity from the blocknr
argument before cracking it into a group number and a block number
within a group.  IOWs, block group 0 spans blocks 1-8192 (1-based)
instead of 0-8191 (0-based) like what happens with larger blocksizes.

The net result of this encoding is that blocknr \< s\_first\_data\_block is
not a valid input to this function.  The end\_fsb variable is set from
the keys that are copied from userspace, which means that in the above
example, its value is zero.  That leads to an underflow here:

	blocknr = blocknr - le32\_to\_cpu(es-\>s\_first\_data\_block);

The division then operates on -1:

	offset = do\_div(blocknr, EXT4\_BLOCKS\_PER\_GROUP(sb)) \>\>
		EXT4\_SB(sb)-\>s\_cluster\_bits;

Leaving an impossibly large group number (2^32-1) in blocknr.
ext4\_getfsmap\_check\_keys checked that keys\[0
---truncated---

## Affected and fixed versions

- Linux: \>= 4a4956249dac0b9b0027949907bff0cd1a9b57fa, \< a70b49dc7eee5dbe3775a650ce598e3557ff5475; \>= 4a4956249dac0b9b0027949907bff0cd1a9b57fa, \< f16054ac1774915160ca4e1c73ff7a269465a1b9; \>= 4a4956249dac0b9b0027949907bff0cd1a9b57fa, \< c24f838493792b5e78a3596b4ca96375aa0af4c2; \>= 4a4956249dac0b9b0027949907bff0cd1a9b57fa, \< 1d2366624b4c19a2ba6baf67fe57f4a1b0f67c05; \>= 4a4956249dac0b9b0027949907bff0cd1a9b57fa, \< c5d7c31e17224d847a330180ec1b03bf390632b2; \>= 4a4956249dac0b9b0027949907bff0cd1a9b57fa, \< eb3a695aa71a514f2e7f5778e05faba3733b70a0; \>= 4a4956249dac0b9b0027949907bff0cd1a9b57fa, \< 15ebade3266b300da9cd1edce4004fe8fd6a2b88; \>= 4a4956249dac0b9b0027949907bff0cd1a9b57fa, \< c993799baf9c5861f8df91beb80e1611b12efcbd (cvelist)
- Linux: 4.13 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2023-53143. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2023-53143.md
Affected: Linux >= 4a4956249dac0b9b0027949907bff0cd1a9b57fa, < a70b49dc7eee5dbe3775a650ce598e3557ff5475; >= 4a4956249dac0b9b0027949907bff0cd1a9b57fa, < f16054ac1774915160ca4e1c73ff7a269465a1b9; >= 4a4956249dac0b9b0027949907bff0cd1a9b57fa, < c24f838493792b5e78a3596b4ca96375aa0af4c2; >= 4a4956249dac0b9b0027949…
Fixed in: Linux 1d2366624b4c19a2ba6baf67fe57f4a1b0f67c05, Linux 15ebade3266b300da9cd1edce4004fe8fd6a2b88

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2023-53143 being exploited?

There is no confirmed exploitation: CVE-2023-53143 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.29% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2023-53143?

Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2023-53143?

Linux \>= 4a4956249dac0b9b0027949907bff0cd1a9b57fa, \< a70b49dc7eee5dbe3775a650ce598e3557ff5475; \>= 4a4956249dac0b9b0027949907bff0cd1a9b57fa, \< f16054ac1774915160ca4e1c73ff7a269465a1b9; \>= 4a4956249dac0b9b0027949907bff0cd1a9b57fa, \< c24f838493792b5e78a3596b4ca96375aa0af4c2; \>= 4a4956249dac0b9b0027949907bff0cd1a9b57fa, \< 1d2366624b4c19a2ba6baf67fe57f4a1b0f67c05; \>= 4a4956249dac0b9b0027949907bff0cd1a9b57fa, \< c5d7c31e17224d847a330180ec1b03bf390632b2; \>= 4a4956249dac0b9b0027949907bff0cd1a9b57fa, \< eb3a695aa71a514f2e7f5778e05faba3733b70a0; \>= 4a4956249dac0b9b0027949907bff0cd1a9b57fa, \< 15ebade3266b300da9cd1edce4004fe8fd6a2b88; \>= 4a4956249dac0b9b0027949907bff0cd1a9b57fa, \< c993799baf9c5861f8df91beb80e1611b12efcbd; Linux 4.13.

### Is there a fix for CVE-2023-53143?

Yes. Fixed in Linux 1d2366624b4c19a2ba6baf67fe57f4a1b0f67c05, Linux 15ebade3266b300da9cd1edce4004fe8fd6a2b88. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2023-53143?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/a70b49dc7eee5dbe3775a650ce598e3557ff5475>
- patch: <https://git.kernel.org/stable/c/f16054ac1774915160ca4e1c73ff7a269465a1b9>
- patch: <https://git.kernel.org/stable/c/c24f838493792b5e78a3596b4ca96375aa0af4c2>
- patch: <https://git.kernel.org/stable/c/1d2366624b4c19a2ba6baf67fe57f4a1b0f67c05>
- patch: <https://git.kernel.org/stable/c/c5d7c31e17224d847a330180ec1b03bf390632b2>
- patch: <https://git.kernel.org/stable/c/eb3a695aa71a514f2e7f5778e05faba3733b70a0>
- patch: <https://git.kernel.org/stable/c/15ebade3266b300da9cd1edce4004fe8fd6a2b88>
- patch: <https://git.kernel.org/stable/c/c993799baf9c5861f8df91beb80e1611b12efcbd>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2023-53143>

HTML: <https://flawdb.com/CVE-2023-53143> · JSON: <https://flawdb.com/api/v1/entries/CVE-2023-53143>
