Bug 2527981

Summary: CVE-2026-71219 gfs2-utils: gfs2-utils: stack overflow via alloca(1<<di_depth) in hash table traversal [fedora-all]
Product: [Fedora] Fedora Reporter: Samuele Negrini <snegrini>
Component: gfs2-utilsAssignee: Andrew Price <anprice>
Status: NEW --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: agk, agruenba, anprice, bmarzins, cfeist
Target Milestone: ---Keywords: Security, SecurityTracking
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: {"flaws": ["da400d38-ce58-453a-b14b-763949324b4f"]}
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2507750    

Description Samuele Negrini 2026-09-03 11:41:25 UTC
Disclaimer: Community trackers are created by Red Hat Product Security team on a best effort basis. Package maintainers are required to ascertain if the flaw indeed affects their package, before starting the update process.

A flaw was found in gfs2-utils. The hash table traversal code in fsck.gfs2 (metawalk.c) uses alloca(1 << di_depth) where di_depth is a uint16 field read directly from on-disk directory inode metadata without bounds validation. An attacker can craft a GFS2 filesystem image with a large di_depth value (e.g., 24+) that causes an exponentially large stack allocation (1 << 24 = 16M entries * 8 bytes = 128MB), far exceeding the default 8MB stack limit and crashing the process with SIGSEGV.

Additionally, for di_depth >= 31 on platforms where int is 32 bits, the expression 1 << di_depth invokes undefined behavior (signed integer overflow per C11 6.5.7p4), which may produce a small or wrapped alloca result rather than a large one, with unpredictable consequences.

The Linux kernel GFS2 driver validates i_depth in gfs2_dinode_in() (see CVE-2025-38710), but the userspace gfs2-utils performs no equivalent validation. This affects fsck.gfs2, gfs2_edit, and savemeta when processing directory metadata from crafted images.