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
Unknown Object (File)
Thu, Aug 13, 1:14 PM
Unknown Object (File)
Thu, Aug 13, 1:42 AM
Unknown Object (File)
Wed, Aug 12, 11:57 PM
Unknown Object (File)
Tue, Aug 11, 1:55 PM
Unknown Object (File)
Mon, Aug 10, 1:04 PM
Unknown Object (File)
Mon, Aug 10, 11:28 AM
Unknown Object (File)
Mon, Aug 10, 9:40 AM
Unknown Object (File)
Sun, Aug 9, 5:59 AM
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