Page MenuHomeFreeBSD

casper: document that most libcasper and cap_net functions are not thread-safe
ClosedPublic

Authored by asomers on Dec 6 2023, 5:24 PM.
Tags
None
Referenced Files
F140088392: D42928.id131167.diff
Sat, Dec 20, 2:08 AM
Unknown Object (File)
Sun, Dec 7, 10:52 PM
Unknown Object (File)
Fri, Nov 28, 11:10 PM
Unknown Object (File)
Tue, Nov 25, 7:08 PM
Unknown Object (File)
Sat, Nov 22, 1:22 AM
Unknown Object (File)
Nov 13 2025, 1:09 PM
Unknown Object (File)
Nov 13 2025, 12:19 PM
Unknown Object (File)
Nov 13 2025, 9:07 AM
Subscribers

Details

Summary

Because internally they all use cap_xfer_nvlist. cap_xfer_nvlist sends
and then receives data over a unix domain socket and associated with the
cap_channel_t argument. So absent synchronization, two threads may not
use the same cap_channel_t argument or they risk receiving the other's
reply.

MFC after: 2 weeks
Sponsored by: Axcient

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 54822
Build 51711: arc lint + arc unit

Event Timeline

@oshogbo do you agree with this wording? If so I'll add it to the other casper services' man pages and update the revision.

LGTM, thank you for working on this.

  • Add reentrancy notices to the other casper service man pages, too.

@oshogbo I've updated all of them now. But do you think that this is too pedantic? Maybe I'm just a cossetted Rust programmer who expects that everything is thread-safe by default.

I've updated all of them now. But do you think that this is too pedantic

No, I think that this is a fair statement. I have a couple of questions about this and the libnv.

Maybe I'm just a cossetted Rust programmer who expects that everything is thread-safe by default.

Everything has pros and cons. Recently, I saw somebody implementing a double-linked list in Rust. It seems like a nightmare.

This revision is now accepted and ready to land.Dec 8 2023, 4:04 PM