archive mirror
 help / color / mirror / Atom feed
* CVE-2023-52622: ext4: avoid online resizing failures due to oversized flex bg
@ 2024-03-26 17:19 Lee Jones
  0 siblings, 0 replies; only message in thread
From: Lee Jones @ 2024-03-26 17:19 UTC (permalink / raw)
  To: linux-cve-announce; +Cc: Lee Jones


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

ext4: avoid online resizing failures due to oversized flex bg

When we online resize an ext4 filesystem with a oversized flexbg_size,

     mkfs.ext4 -F -G 67108864 $dev -b 4096 100M
     mount $dev $dir
     resize2fs $dev 16G

the following WARN_ON is triggered:
WARNING: CPU: 0 PID: 427 at mm/page_alloc.c:4402 __alloc_pages+0x411/0x550
Modules linked in: sg(E)
CPU: 0 PID: 427 Comm: resize2fs Tainted: G  E  6.6.0-rc5+ #314
RIP: 0010:__alloc_pages+0x411/0x550
Call Trace:

This is because flexbg_size is too large and the size of the new_group_data
array to be allocated exceeds MAX_ORDER. Currently, the minimum value of
MAX_ORDER is 8, the minimum value of PAGE_SIZE is 4096, the corresponding
maximum number of groups that can be allocated is:

 (PAGE_SIZE << MAX_ORDER) / sizeof(struct ext4_new_group_data) ≈ 21845

And the value that is down-aligned to the power of 2 is 16384. Therefore,
this value is defined as MAX_RESIZE_BG, and the number of groups added
each time does not exceed this value during resizing, and is added multiple
times to complete the online resizing. The difference is that the metadata
in a flex_bg may be more dispersed.

The Linux kernel CVE team has assigned CVE-2023-52622 to this issue.

Affected and fixed versions

	Fixed in 4.19.307 with commit cd1f93ca97a9
	Fixed in 5.4.269 with commit b183fe8702e7
	Fixed in 5.10.210 with commit cfbbb3199e71
	Fixed in 5.15.149 with commit d76c8d7ffe16
	Fixed in 6.1.77 with commit 6d2cbf517dca
	Fixed in 6.6.16 with commit 8b1413dbfe49
	Fixed in 6.7.4 with commit dc3e0f55bec4
	Fixed in 6.8 with commit 5d1935ac02ca

Please see for a full list of currently supported
kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to
older supported kernel versions.  The official CVE entry at
will be updated if fixes are backported, please check that for the most
up to date information about this issue.

Affected files

The file(s) affected by this issue are:


The Linux kernel CVE team recommends that you update to the latest
stable kernel version for this, and many other bugfixes.  Individual
changes are never tested alone, but rather are part of a larger kernel
release.  Cherry-picking individual commits is not recommended or
supported by the Linux kernel community at all.  If however, updating to
the latest release is impossible, the individual changes to resolve this
issue can be found at these commits:

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-03-26 17:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-26 17:19 CVE-2023-52622: ext4: avoid online resizing failures due to oversized flex bg Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).