Page MenuHomeFreeBSD

cap_fileargs: Fix a descriptor leak in the service process.
ClosedPublic

Authored by markj on Jun 1 2020, 2:44 PM.
Tags
None
Referenced Files
F81579794: D25095.diff
Thu, Apr 18, 10:35 AM
Unknown Object (File)
Wed, Apr 17, 11:16 PM
Unknown Object (File)
Wed, Apr 17, 11:08 PM
Unknown Object (File)
Mar 11 2024, 6:12 AM
Unknown Object (File)
Jan 20 2024, 5:24 PM
Unknown Object (File)
Jan 12 2024, 3:24 PM
Unknown Object (File)
Dec 29 2023, 3:43 AM
Unknown Object (File)
Dec 22 2023, 11:27 PM
Subscribers

Details

Summary

The service handler for fileargs_open() tries to pre-open multiple files
and pass descriptors for each back to the sandboxed process in a single
message. This is to amortize the cost of round-trips between the two
processes.

The service process adds a "cache" nvlist to the reply to "open",
containing file descriptors for pre-opened files. However, when adding
that nvlist to the reply, it was making a copy, leaving the cached FDs
open in the service process. They are effectively leaked, which causes
problems when an FD limit is placed on the parent process.

While here, fix spelling in a local variable name.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable