powerpc/64s: Fix VAS mm use after free
authorNicholas Piggin <npiggin@gmail.com>
Wed, 7 Jun 2023 10:10:24 +0000 (20:10 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Jul 2023 14:21:38 +0000 (16:21 +0200)
commit4e82f92c349ea603736ade1e814861c0182a55ad
tree311cc527d4b1e71f4cc7b204c420f0d9d22ae495
parent75d65c1cc439606ada882755fd205d13c2c7907d
powerpc/64s: Fix VAS mm use after free

[ Upstream commit b4bda59b47879cce38a6ec5a01cd3cac702b5331 ]

The refcount on mm is dropped before the coprocessor is detached.

Reported-by: Sachin Sant <sachinp@linux.ibm.com>
Fixes: 7bc6f71bdff5f ("powerpc/vas: Define and use common vas_window struct")
Fixes: b22f2d88e435c ("powerpc/pseries/vas: Integrate API with open/close windows")
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Tested-by: Sachin Sant <sachinp@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230607101024.14559-1-npiggin@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/powerpc/platforms/powernv/vas-window.c
arch/powerpc/platforms/pseries/vas.c