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

Fix PR_SET_CHILD_SUBREAPER call #67

Merged
merged 2 commits into from
Dec 17, 2016
Merged

Fix PR_SET_CHILD_SUBREAPER call #67

merged 2 commits into from
Dec 17, 2016

Conversation

krallin
Copy link
Owner

@krallin krallin commented Dec 17, 2016

PR_SET_CHILD_SUBREAPER actually requires a non-zero argument to prctl
in order to work..!

Now, this used to work just fine (and currently works in most places)
because when we use a libc that doesn't know about
PR_SET_CHILD_SUBREAPER, it doesn't do anything about the second argument
passed to pctrl, so we end up sending some junk in as the second
argument. What we send appears to be completely random and as such seems
very unlikely to be zero, and so things appear to work (e.g. the tests
all pass, etc.).

However, using a libc that does know about this argument (e.g. Ubuntu
Xenial), things don't work because the second argument is
automatically set to 0 when we don't provide one.

This probably went unnoticed for a while considering that tini-static
isn't affected (it's built on Trusty), and that this mode isn't enabled
by default in the first place.

PR_SET_CHILD_SUBREAPER actually requires a non-zero argument to `prctl`
in order to work..!

Now, this used to work just fine (and currently works in most places)
because when we use a libc that doesn't know about
PR_SET_CHILD_SUBREAPER, it doesn't do anything about the second argument
passed to `pctrl`, so we end up sending some junk in as the second
argument. What we send appears to be completely random and as such seems
very unlikely to be zero, and so things appear to work (e.g. the tests
all pass, etc.).

However, using a libc that does know about this argument (e.g. Ubuntu
Xenial), things *don't* work because the second argument is
automatically set to 0 when we don't provide one.

This probably went unnoticed for a while considering that `tini-static`
isn't affected (it's built on Trusty), and that this mode isn't enabled
by default in the first place.
@krallin krallin merged commit 79016ec into master Dec 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant