2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-29 23:53:55 +08:00
linux-next/drivers/misc/genwqe
Eric W. Biederman 0ab93e9c99 signal/GenWQE: Fix sending of SIGKILL
The genweq_add_file and genwqe_del_file by caching current without
using reference counting embed the assumption that a file descriptor
will never be passed from one process to another.  It even embeds the
assumption that the the thread that opened the file will be in
existence when the process terminates.   Neither of which are
guaranteed to be true.

Therefore replace caching the task_struct of the opener with
pid of the openers thread group id.  All the knowledge of the
opener is used for is as the target of SIGKILL and a SIGKILL
will kill the entire process group.

Rename genwqe_force_sig to genwqe_terminate, remove it's unncessary
signal argument, update it's ownly caller, and use kill_pid
instead of force_sig.

The work force_sig does in changing signal handling state is not
relevant to SIGKILL sent as SEND_SIG_PRIV.  The exact same processess
will be killed just with less work, and less confusion.  The work done
by force_sig is really only needed for handling syncrhonous
exceptions.

It will still be possible to cause genwqe_device_remove to wait
8 seconds by passing a file descriptor to another process but
the possible user after free is fixed.

Fixes: eaf4722d46 ("GenWQE Character device and DDCB queue")
Cc: stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Frank Haverkamp <haver@linux.vnet.ibm.com>
Cc: Joerg-Stephan Vogt <jsvogt@de.ibm.com>
Cc: Michael Jung <mijung@gmx.net>
Cc: Michael Ruettger <michael@ibmra.de>
Cc: Kleber Sacilotto de Souza <klebers@linux.vnet.ibm.com>
Cc: Sebastian Ott <sebott@linux.vnet.ibm.com>
Cc: Eberhard S. Amann <esa@linux.vnet.ibm.com>
Cc: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Cc: Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
2018-09-15 16:07:19 +02:00
..
card_base.c genwqe: Make defines uppercase 2017-12-19 10:54:44 +01:00
card_base.h signal/GenWQE: Fix sending of SIGKILL 2018-09-15 16:07:19 +02:00
card_ddcb.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
card_ddcb.h GenWQE: Update author information 2014-09-23 23:15:46 -07:00
card_debugfs.c misc: genwqe: remove several redundant variables 2018-07-03 13:01:47 +02:00
card_dev.c signal/GenWQE: Fix sending of SIGKILL 2018-09-15 16:07:19 +02:00
card_sysfs.c GenWQE: use kobj_to_dev() 2016-02-08 14:57:30 -08:00
card_utils.c GenWQE: Fix a typo in two comments 2018-03-27 09:51:22 +02:00
genwqe_driver.h GenWQE: Update author information 2014-09-23 23:15:46 -07:00
Kconfig GenWQE: Add support for EEH error recovery 2014-07-09 14:14:27 -07:00
Makefile GenWQE Enable driver 2013-12-18 16:51:15 -08:00