]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/powernv/vas: Release reference to tgid during window close
authorHaren Myneni <haren@linux.ibm.com>
Thu, 17 Jun 2021 20:29:05 +0000 (13:29 -0700)
committerMichael Ellerman <mpe@ellerman.id.au>
Sun, 20 Jun 2021 11:58:55 +0000 (21:58 +1000)
commitabdf7e5330319e664a73c745b0065d3f55c0e985
tree3d179fcea2319675b8d63ea566a60d4a1ff75058
parent3f1f4a7a55d980f23a2227ab55b93c85faabe71a
powerpc/powernv/vas: Release reference to tgid during window close

The kernel handles the NX fault by updating CSB or sending
signal to process. In multithread applications, children can
open VAS windows and can exit without closing them. But the
parent can continue to send NX requests with these windows. To
prevent pid reuse, reference will be taken on pid and tgid
when the window is opened and release them during window close.

The current code is not releasing the tgid reference which can
cause pid leak and this patch fixes the issue.

Fixes: 9c40e11114023 ("powerpc/vas: Take reference to PID and mm for user space windows")
Cc: stable@vger.kernel.org # 5.8+
Reported-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Haren Myneni <haren@linux.ibm.com>
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/6020fc4d444864fe20f7dcdc5edfe53e67480a1c.camel@linux.ibm.com
arch/powerpc/platforms/powernv/vas-window.c