HomeFreeBSD

geli: allocate a UMA pool earlier

Description

geli: allocate a UMA pool earlier

The functions g_eli_init_uma and g_eli_fini_uma are used to trace
the number of devices in GELI. There is an issue where the g_eli_create
function may fail before g_eli_init_uma is called, however
g_eli_fini_uma is still executed in the fail path. This can
incorrectly decrease the device count to zero, potentially leading to
the UMA pool being freed. Accessing the device after the pool has been
freed causes a system panic.

This commit resolves the issue by ensuring devices count is increassed
eariler.

PR: 278828
Reported by: Andre Albsmeier <mail@fbsd2.e4m.org>
Reviewed by: asomers
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D45225

Details

Provenance
oshogboAuthored on May 19 2024, 12:53 PM
Reviewer
asomers
Differential Revision
D45225: geli: Allocate a UMA pool earlier
Parents
rGff4480baf6f1: nfs client comment typo fix
Branches
Unknown
Tags
Unknown