Page MenuHomeFreeBSD

jaildesc: Publish the new fd only after the jaildesc is initialized
ClosedPublic

Authored by markj on Jul 5 2026, 9:34 PM.
Tags
None
Referenced Files
F165919239: D58049.id.diff
Mon, Aug 10, 1:04 PM
F165906331: D58049.id181324.diff
Mon, Aug 10, 11:28 AM
F165874687: D58049.diff
Mon, Aug 10, 9:40 AM
Unknown Object (File)
Sun, Aug 9, 5:59 AM
Unknown Object (File)
Sat, Aug 8, 10:55 PM
Unknown Object (File)
Sat, Aug 8, 8:14 PM
Unknown Object (File)
Sat, Aug 8, 6:47 PM
Unknown Object (File)
Sat, Aug 8, 2:19 PM
Subscribers

Details

Summary

jaildesc_alloc() finishes initializing the file structure only after it
is made visible from the file descriptor table via finit(). In that
window, other threads could try to perform operations on the descriptor
and thus access an incompletely initialized jaildesc.

Defer the finit() call until locks are initialized. While here,
simplify the error path for falloc_caps().

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable