Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

start: handle setting pdeath signal in new pidns #2933

Merged
merged 1 commit into from Oct 4, 2019

Conversation

@brauner
Copy link
Member

commented Apr 13, 2019

In the usual case the child runs in a separate pid namespace. So far we haven't
been able to reliably set the pdeath signal. When we set the pdeath signal we
need to verify that we haven't lost a race whereby we have been orphaned and
though we have set a pdeath signal it won't help us since, well, the parent is
dead.
We were able to correctly handle this case when we were in the same pidns since
getppid() will return a valid pid. When we are in a separate pidns 0 will be
returned since the parent doesn't exist in our pidns.
A while back, while Jann and I were discussing other things he came up
with a nifty idea: simply pass an fd for the parent's status file and check the
"State:" field. This is the implementation of that idea.

Suggested-by: Jann Horn jann@thejh.net
Signed-off-by: Christian Brauner christian.brauner@ubuntu.com

@brauner brauner requested a review from stgraber Apr 13, 2019
@brauner

This comment has been minimized.

Copy link
Member Author

commented Apr 13, 2019

//Cc @flx42

@brauner brauner force-pushed the brauner:2019-04-13/pdeath_signal_fixes branch 3 times, most recently from e84f33e to f1369bf Apr 13, 2019
@brauner brauner added the Incomplete label Apr 13, 2019
@brauner brauner force-pushed the brauner:2019-04-13/pdeath_signal_fixes branch 4 times, most recently from de9569a to c496ae4 Apr 13, 2019
@brauner brauner removed the Incomplete label Apr 14, 2019
@brauner

This comment has been minimized.

Copy link
Member Author

commented Apr 14, 2019

jenkins: test this please

@brauner brauner force-pushed the brauner:2019-04-13/pdeath_signal_fixes branch from c496ae4 to cabdf90 Apr 14, 2019
@stgraber

This comment has been minimized.

Copy link
Member

commented Aug 27, 2019

Needs rebasing

@lxc-jenkins

This comment has been minimized.

Copy link

commented Aug 27, 2019

Testsuite passed

In the usual case the child runs in a separate pid namespace. So far we haven't
been able to reliably set the pdeath signal. When we set the pdeath signal we
need to verify that we haven't lost a race whereby we have been orphaned and
though we have set a pdeath signal it won't help us since, well, the parent is
dead.
We were able to correctly handle this case when we were in the same pidns since
getppid() will return a valid pid. When we are in a separate pidns 0 will be
returned since the parent doesn't exist in our pidns.
A while back, while Jann and I were discussing other things he came up with a
nifty idea: simply pass an fd for the parent's status file and check the
"State:" field. This is the implementation of that idea.

Suggested-by: Jann Horn <jann@thejh.net>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
@hallyn hallyn force-pushed the brauner:2019-04-13/pdeath_signal_fixes branch from cabdf90 to 4d8bdfa Oct 4, 2019
@hallyn hallyn merged commit 345a21c into lxc:master Oct 4, 2019
0 of 4 checks passed
0 of 4 checks passed
Branch target Check pending
Details
DCO Check pending
Details
Testsuite Test pending
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants
You can’t perform that action at this time.