Page MenuHomeFreeBSD

rpcbind: Fix race in signal termination
ClosedPublic

Authored by cem on Jan 2 2018, 2:05 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 19, 6:15 AM
Unknown Object (File)
Dec 20 2023, 2:05 AM
Unknown Object (File)
Nov 8 2023, 5:49 PM
Unknown Object (File)
Nov 6 2023, 12:13 AM
Unknown Object (File)
Oct 8 2023, 9:57 AM
Unknown Object (File)
Oct 7 2023, 4:33 PM
Unknown Object (File)
Oct 4 2023, 11:12 PM
Unknown Object (File)
Sep 30 2023, 11:08 PM
Subscribers

Details

Reviewers
kib
markj
Summary

If signal was delivered while the main thread was not in poll(2) and after
check was performed, we could reenter poll and never detect termination. Fix
this with the pipefd trick.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 14057
Build 14241: arc lint + arc unit

Event Timeline

markj added inline comments.
usr.sbin/rpcbind/rpcbind.c
781

It'd probably be reasonable to _exit() if the write somehow fails?

This revision is now accepted and ready to land.Jan 2 2018, 5:14 AM
usr.sbin/rpcbind/rpcbind.c
781

Sure.

cem marked 2 inline comments as done.

Abort nice program shutdown on unexpected pipefd write(2) failure.

This revision now requires review to proceed.Jan 2 2018, 5:23 AM
This revision is now accepted and ready to land.Jan 2 2018, 5:24 AM

I wonder whether your fixes are enough to remove #ifdef WARMSTART and have this feature compiled in unconditionally.