Page MenuHomeFreeBSD

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

Authored by markj on Sun, Jul 5, 9:34 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Jul 15, 7:29 AM
Unknown Object (File)
Wed, Jul 15, 7:29 AM
Unknown Object (File)
Wed, Jul 15, 1:34 AM
Unknown Object (File)
Wed, Jul 15, 12:39 AM
Unknown Object (File)
Tue, Jul 14, 8:06 PM
Unknown Object (File)
Mon, Jul 13, 8:59 AM
Unknown Object (File)
Sun, Jul 12, 3:30 AM
Unknown Object (File)
Sun, Jul 12, 3:21 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