[GIT PULL] pidfd fixes for v5.2-rc1

From: Christian Brauner
Date: Fri May 10 2019 - 08:58:05 EST


Hi Linus,

The following changes since commit 8ea5b2abd07e2280a332bd9c1a7f4dd15b9b6c13:

Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs (2019-05-09 19:35:41 -0700)

are available in the Git repository at:

git@xxxxxxxxxxxxxxxxxxx:pub/scm/linux/kernel/git/brauner/linux tags/pidfd-fixes-v5.2-rc1

for you to fetch changes up to c3b7112df86b769927a60a6d7175988ca3d60f09:

fork: do not release lock that wasn't taken (2019-05-10 14:26:12 +0200)

I originally intended to send out a pr middle of next week to fix the bug you
reported but syzkaller found another bug that we should fix rather quickly.
Since no rc1 is out for 5.2 and the pidfd patchset had conflicts with Andrew's
tree and the kbuild tree I have simply based the pull request on current
mainline.

/* Summary */
This pull request fixes two bugs.
The first one reported by Linus whereby the pidfd-metadata binary was not
placed in a .gitignore file.
The second one is rather urgent and fixes a locking issue found by syzkaller.
What happened is that during process creation we need to check whether the
cgroup we are in allows us to fork. To perform this check the cgroup needs to
guard itself against threadgroup changes and takes a lock. Prior to CLONE_PIDFD
the cleanup target "bad_fork_free_pid" would also need to release said lock.
That's not true anymore since CLONE_PIDFD so this is fixed here. Syzkaller has
tested the patch and was not able to reproduce the issue.

Please consider pulling these changes from the signed pidfd-fixes-v5.2-rc1 tag.
Christian

----------------------------------------------------------------
pidfd fixes for v5.2-rc1

----------------------------------------------------------------
Christian Brauner (2):
samples: add .gitignore for pidfd-metadata
fork: do not release lock that wasn't taken

kernel/fork.c | 5 +++--
samples/pidfd/.gitignore | 1 +
2 files changed, 4 insertions(+), 2 deletions(-)
create mode 100644 samples/pidfd/.gitignore