rpcbind: Fix race in signal termination
ClosedPublic

Authored by cem on Jan 2 2018, 2:05 AM.

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
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 14057
Build 14241: arc lint + arc unit
cem created this revision.Jan 2 2018, 2:05 AM
markj accepted this revision.Jan 2 2018, 5:14 AM
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
cem added inline comments.Jan 2 2018, 5:21 AM
usr.sbin/rpcbind/rpcbind.c
781

Sure.

cem updated this revision to Diff 37393.Jan 2 2018, 5:23 AM
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
markj accepted this revision.Jan 2 2018, 5:24 AM
This revision is now accepted and ready to land.Jan 2 2018, 5:24 AM
kib accepted this revision.Jan 2 2018, 10:42 AM

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

cem closed this revision.Jan 2 2018, 5:28 PM

r327495