Page MenuHomeFreeBSD

Optimize libnv descriptor passing.
AbandonedPublic

Authored by markj on Jul 12 2019, 9:42 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 20 2023, 5:54 AM
Unknown Object (File)
Dec 13 2023, 4:04 PM
Unknown Object (File)
Nov 15 2023, 7:46 AM
Unknown Object (File)
Aug 15 2023, 9:01 AM
Unknown Object (File)
Aug 15 2023, 8:58 AM
Unknown Object (File)
Jul 4 2023, 5:35 AM
Unknown Object (File)
Jun 25 2023, 5:09 AM
Unknown Object (File)
May 14 2023, 6:34 PM
Subscribers
None

Details

Reviewers
oshogbo
pjd
Group Reviewers
capsicum
Summary

Use a single CMSG for all passed descriptors. This lets us pack more
descriptors in a single message, which is useful for cap_fileargs.

Add a regression test which passes an nvlist containing many descriptors
over a unix socket pair.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 25326
Build 23986: arc lint + arc unit

Event Timeline

Hmmm. Do we care about supporting Linux anymore given that it seems Capsicum is not going into mainline Linux? I am fine with dropping this patch, but it seems a bit of a shame since it is faster and more space-efficient to send multiple FDs in a single control message.

libnv may be used in different places as well, not only Capsicum.
Right now it is cross build: https://github.com/fudosecurity/nvlist

I also wonder is there is no limit in FreeBSD to the count how many fd we can send in single message.
If so we could have both methods but we still would need to split how many of them we are sending.

libnv may be used in different places as well, not only Capsicum.
Right now it is cross build: https://github.com/fudosecurity/nvlist

Thanks, I will leave this change for now then.

I also wonder is there is no limit in FreeBSD to the count how many fd we can send in single message.

It's limited by the number of fd pointers we can fit in an mbuf cluster.

If so we could have both methods but we still would need to split how many of them we are sending.

I committed the bug fix already. It might still be useful to attempt optimization on FreeBSD, but I have no plans to work on it in the near future.