]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - kernel/pid.c
Fix failure path in alloc_pid()
authorMatthew Wilcox <willy@infradead.org>
Fri, 28 Dec 2018 15:22:26 +0000 (07:22 -0800)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit83d664120f81be986654484ca00d6ee013d39689
tree87fd8982b0ef5f7c82ccc873ba28e4e4db43f151
parent47ce46a1bb6c6ebe1de8700790fd6d8414dedbfd
Fix failure path in alloc_pid()

BugLink: https://bugs.launchpad.net/bugs/1837477
commit 1a80dade010c7a7f4885a4c4c2a7ac22cc7b34df upstream.

The failure path removes the allocated PIDs from the wrong namespace.
This could lead to us inadvertently reusing PIDs in the leaf namespace
and leaking PIDs in parent namespaces.

Fixes: 95846ecf9dac ("pid: replace pid bitmap implementation with IDR API")
Cc: <stable@vger.kernel.org>
Signed-off-by: Matthew Wilcox <willy@infradead.org>
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
kernel/pid.c