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)
Wed, May 8, 1:11 PM
Unknown Object (File)
Wed, May 8, 1:11 PM
Unknown Object (File)
Wed, May 8, 11:35 AM
Unknown Object (File)
Wed, May 8, 11:34 AM
Unknown Object (File)
Thu, Apr 25, 2:24 PM
Unknown Object (File)
Thu, Apr 25, 2:24 PM
Unknown Object (File)
Thu, Apr 25, 2:24 PM
Unknown Object (File)
Thu, Apr 25, 1:58 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