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
Unknown Object (File)
Thu, Nov 14, 10:51 AM
Unknown Object (File)
Thu, Nov 14, 10:51 AM
Unknown Object (File)
Mon, Nov 11, 11:17 AM
Unknown Object (File)
Sun, Nov 3, 2:05 PM
Unknown Object (File)
Sun, Nov 3, 2:04 PM
Unknown Object (File)
Sun, Nov 3, 2:04 PM
Unknown Object (File)
Sun, Nov 3, 2:04 PM
Unknown Object (File)
Sun, Nov 3, 1:52 PM
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 Not Applicable
Unit
Tests Not Applicable

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