projects/linux·commit b2768df2

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace

b2768df2 · Linus Torvalds <[email protected]> · 2020-04-25 12:25:32 -07:00

Pull pid leak fix from Eric Biederman:
 "Oleg noticed that put_pid(thread_pid) was not getting called when proc
  was not compiled in.

  Let's get that fixed before 5.7 is released and causes problems for
  anyone"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace:
  proc: Put thread_pid in release_task not proc_flush_pid
Commit
b2768df24ec400dd4f7fa79542f797e904812053
Parents
acd62944 · 6ade99ec

Merge commit. Changes below are compared with the first parent: acd62944.

Changes

2 files changed · +1 −1

FileStatusAddDelContent
fs/proc/base.cmodified+0−1View file
kernel/exit.cmodified+1−0View file

fs/proc/base.c

View file
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 572898d..eb2255e 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -3286,7 +3286,6 @@ static const struct inode_operations proc_tgid_base_inode_operations = {
void proc_flush_pid(struct pid *pid)
{
proc_invalidate_siblings_dcache(&pid->inodes, &pid->lock);
- put_pid(pid);
}
static struct dentry *proc_pid_instantiate(struct dentry * dentry,

kernel/exit.c

View file
diff --git a/kernel/exit.c b/kernel/exit.c
index 389a88c..ce2a75b 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -219,6 +219,7 @@ repeat:
write_unlock_irq(&tasklist_lock);
proc_flush_pid(thread_pid);
+ put_pid(thread_pid);
release_thread(p);
put_task_struct_rcu_user(p);