]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
um: chan_user: Fix winch_tramp() return value
authorJohannes Berg <johannes.berg@intel.com>
Fri, 20 May 2022 17:45:36 +0000 (19:45 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Jun 2022 14:59:29 +0000 (16:59 +0200)
commitf8dddfcdbc46796ef469031ef4182669a6dd3919
treef3d4e69d5945f45889af7fe5fd2cbc0ec48f91cc
parentd766673961c57c8b2e97c41451306b1bca452135
um: chan_user: Fix winch_tramp() return value

commit 57ae0b67b747031bc41fb44643aa5344ab58607e upstream.

The previous fix here was only partially correct, it did
result in returning a proper error value in case of error,
but it also clobbered the pid that we need to return from
this function (not just zero for success).

As a result, it returned 0 here, but later this is treated
as a pid and used to kill the process, but since it's now
0 we kill(0, SIGKILL), which makes UML kill itself rather
than just the helper thread.

Fix that and make it more obvious by using a separate
variable for the pid.

Fixes: ccf1236ecac4 ("um: fix error return code in winch_tramp()")
Reported-and-tested-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/um/drivers/chan_user.c