android_kernel_oneplus_msm8998/drivers/misc
Eric W. Biederman 5f894b3ee3 signal/GenWQE: Fix sending of SIGKILL
commit 0ab93e9c99f8208c0a1a7b7170c827936268c996 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-21 09:27:34 +01:00
..
altera-stapl
c2port drivers/misc/c2port/c2port-duramar2150.c: checking for NULL instead of IS_ERR() 2017-06-26 07:13:10 +02:00
cb710
cxl cxl: Check if vphb exists before iterating over AFU devices 2017-12-25 14:22:08 +01:00
echo
eeprom eeprom: at24: check at24_read/write arguments 2017-12-05 11:22:51 +01:00
genwqe signal/GenWQE: Fix sending of SIGKILL 2018-11-21 09:27:34 +01:00
ibmasm ibmasm: don't write out of bounds in read handler 2018-07-17 11:31:42 +02:00
lis3lv02d spi: Drop owner assignment from spi_drivers 2015-10-28 10:30:17 +09:00
mei mei: bus: type promotion bug in mei_nfc_if_version() 2018-09-26 08:35:10 +02:00
mic misc: mic: SCIF Fix scif_get_new_port() error handling 2018-09-19 22:48:56 +02:00
sgi-gru misc: sgi-gru: fix return of error 2015-10-04 12:55:59 +01:00
sgi-xp mm: rename alloc_pages_exact_node() to __alloc_pages_node() 2015-09-08 15:35:28 -07:00
ti-st misc: ti-st: Fix memory leak in the error path of probe() 2018-09-19 22:48:57 +02:00
vmw_vmci vmci: type promotion bug in qp_host_get_user_memory() 2018-10-10 08:52:03 +02:00
ad525x_dpot-i2c.c misc: ad525x_dpot: Remove unnecessary MODULE_ALIAS() 2015-09-20 19:33:29 -07:00
ad525x_dpot-spi.c spi: Drop owner assignment from spi_drivers 2015-10-28 10:30:17 +09:00
ad525x_dpot.c drivers/misc/ad525x_dpot: AD5274 fix RDAC read back errors 2016-05-04 14:48:52 -07:00
ad525x_dpot.h
apds990x.c
apds9802als.c
arm-charlcd.c
atmel-ssc.c
atmel_tclib.c misc: atmel_tclib: get and use slow clock 2015-10-06 12:33:14 +02:00
bh1770glc.c
bh1780gli.c
bmp085-i2c.c
bmp085-spi.c spi: Drop owner assignment from spi_drivers 2015-10-28 10:30:17 +09:00
bmp085.c
bmp085.h
cs5535-mfgpt.c
ds1682.c
dummy-irq.c
enclosure.c scsi: ses: don't get power status of SES device slot on probe 2018-03-22 09:23:24 +01:00
fsa9480.c
hmc6352.c misc: hmc6352: fix potential Spectre v1 2018-09-26 08:35:07 +02:00
hpilo.c misc: hpilo: Change e-mail address from hp.com to hpe.com 2015-10-04 12:42:33 +01:00
hpilo.h
ics932s401.c
ioc4.c
isl29003.c
isl29020.c
Kconfig misc/bmp085: Enable building as a module 2016-05-04 14:48:51 -07:00
kgdbts.c drivers/misc: make kgdbts.c slightly more explicitly non-modular 2015-09-20 19:32:35 -07:00
lattice-ecp3-config.c spi: Drop owner assignment from spi_drivers 2015-10-28 10:30:17 +09:00
lkdtm.c lkdtm: fix ACCESS_USERSPACE test 2015-10-29 09:02:16 +09:00
Makefile
pch_phub.c
phantom.c
pti.c
qcom-coincell.c
spear13xx_pcie_gadget.c spear13xx_pcie_gadget: use per-attribute show and store methods 2015-10-13 22:17:40 -07:00
sram.c misc: sram: partition base address belongs to __iomem space 2015-10-18 19:00:36 -07:00
ti_dac7512.c spi: Drop owner assignment from spi_drivers 2015-10-28 10:30:17 +09:00
tifm_7xx1.c
tifm_core.c
tsl2550.c tsl2550: fix lux1_input error in low light 2018-10-10 08:52:03 +02:00
vexpress-syscfg.c
vmw_balloon.c vmw_balloon: include asm/io.h 2018-09-19 22:48:59 +02:00