linux/drivers/misc
Oded Gabbay caa3c8e525 habanalabs: all FD must be closed before removing device
This patch fixes a bug in the implementation of the function that removes
the device.

The bug can happen when the device is removed but not the driver itself
(e.g. remove by the OS due to PCI freeze in Power architecture).

In that case, there maybe open users that are calling IOCTLs while the
device is removed. This is a possible race condition that the driver must
handle. Otherwise, a kernel panic may occur.

This race is prevented in the hard-reset flow, because the driver makes
sure the users are closed before continuing with the hard-reset. This
race can not occur when the driver itself is removed because the OS makes
sure all the file descriptors are closed.

The fix is to make sure the open users close their file descriptors and if
they don't (after a certain amount of time), the driver sends them a
SIGKILL, because the remove of the device can't be stopped.

The patch re-uses the same code that is called from the hard-reset flow.

Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
2019-04-06 13:23:54 +03:00
..
altera-stapl altera-stapl: check for a null key before strcasecmp'ing it 2018-11-27 08:44:07 +01:00
c2port
cardreader misc: rtsx: clean up some indenting 2019-03-28 02:09:19 +09:00
cb710 cb710: Convert to new IDA API 2018-08-21 23:54:18 -04:00
cxl Merge branch 'topic/dma' into next 2019-02-21 23:15:10 +11:00
echo misc: echo: Remove unnecessary parentheses and simplify check for zero 2018-09-25 20:21:02 +02:00
eeprom eeprom: at24: implement support for 'num-addresses' property 2019-02-14 09:32:35 +01:00
genwqe cross-tree: phase out dma_zalloc_coherent() 2019-01-08 07:58:37 -05:00
habanalabs habanalabs: all FD must be closed before removing device 2019-04-06 13:23:54 +03:00
ibmasm ibmasm: don't write out of bounds in read handler 2018-07-07 09:59:35 +02:00
lis3lv02d vfs: do bulk POLL* -> EPOLL* replacement 2018-02-11 14:34:03 -08:00
lkdtm lkdtm: change snprintf to scnprintf for possible overflow 2019-01-18 16:34:05 +01:00
mei mei: adjust the copyright notice in the files. 2019-03-28 02:07:54 +09:00
mic 5.1 Merge Window Pull Request 2019-03-09 15:53:03 -08:00
ocxl ocxl: Fix endiannes bug in read_afu_name() 2018-12-21 14:46:50 +11:00
sgi-gru misc/sgi-gru/grufault: fix a style error 2019-01-18 16:34:06 +01:00
sgi-xp sgi-xpc: mark expected switch fall-through 2019-03-28 02:15:51 +09:00
ti-st misc: ti-st: make array read_ver_cmd static, shrinks object size 2018-12-06 15:53:15 +01:00
vmw_vmci VMCI: Support upto 64-bit PPNs 2019-02-26 12:53:55 +01:00
ad525x_dpot-i2c.c drivers: misc: ad525x_dpot: Update MODULE AUTHOR email address 2018-09-14 15:36:20 +02:00
ad525x_dpot-spi.c drivers: misc: ad525x_dpot: Update MODULE AUTHOR email address 2018-09-14 15:36:20 +02:00
ad525x_dpot.c drivers: misc: ad525x_dpot: clean indentation issue, remove tabs 2019-01-18 16:34:05 +01:00
ad525x_dpot.h
apds990x.c misc: apds990x: remove unused array ir_currents 2018-09-12 09:46:46 +02:00
apds9802als.c
aspeed-lpc-ctrl.c misc: aspeed-lpc-ctrl: Enable FWH and A2H bridge cycles 2018-03-15 18:20:51 +01:00
aspeed-lpc-snoop.c drivers/misc: Aspeed LPC snoop output using misc chardev 2018-07-16 13:30:47 +02:00
atmel_tclib.c
atmel-ssc.c misc: atmel-ssc: Fix section annotation on atmel_ssc_get_driver_data 2018-11-11 09:13:19 -08:00
bh1770glc.c misc: bh1770glc: remove unused array prox_curr_ma 2018-09-12 09:46:46 +02:00
cs5535-mfgpt.c
ds1682.c misc: ds1682: Ignore update-in-progress ETC reads 2018-01-09 17:03:57 +01:00
dummy-irq.c
enclosure.c misc: enclosure: Use struct_size() in kzalloc() 2019-01-18 16:34:06 +01:00
fastrpc.c misc: fastrpc: increase max init file size to 64 MB 2019-03-28 02:09:58 +09:00
fsa9480.c misc: fsa9480: Add blank line after declarations. 2018-01-09 17:03:57 +01:00
hmc6352.c misc: hmc6352: fix potential Spectre v1 2018-09-12 09:31:00 +02:00
hpilo.c misc: hpilo: Do not claim unsupported hardware 2019-02-27 16:00:21 +01:00
hpilo.h
ibmvmc.c misc: ibmvsm: Fix potential NULL pointer dereference 2019-01-18 14:14:14 +01:00
ibmvmc.h misc: IBM Virtual Management Channel Driver (VMC) 2018-05-14 16:35:42 +02:00
ics932s401.c misc/ics932s401: Add a missing check to i2c_smbus_read_word_data 2019-01-18 16:34:06 +01:00
ioc4.c
isl29003.c
isl29020.c
Kconfig misc: fastrpc: select CONFIG_DMA_SHARED_BUFFER 2019-02-19 14:50:11 +01:00
kgdbts.c misc: kgdbts: Fix restrict error 2018-09-25 20:21:02 +02:00
lattice-ecp3-config.c
Makefile habanalabs: add skeleton driver 2019-02-18 09:46:43 +01:00
pch_phub.c PCI: Move Rohm Vendor ID to generic list 2019-02-01 17:24:52 -06:00
pci_endpoint_test.c misc: pci_endpoint_test: Add the layerscape EP device support 2019-02-21 10:48:36 +00:00
phantom.c vfs: do bulk POLL* -> EPOLL* replacement 2018-02-11 14:34:03 -08:00
pti.c
pvpanic.c misc: pvpanic: fix warning implicit declaration 2019-01-18 16:42:05 +01:00
qcom-coincell.c
spear13xx_pcie_gadget.c
sram-exec.c
sram.c misc: sram: remove redundant null pointer check before of_node_put 2018-09-25 20:20:59 +02:00
sram.h
tifm_7xx1.c misc: tifm: Remove VLA 2018-04-23 13:31:27 +02:00
tifm_core.c
tsl2550.c tsl2550: fix lux1_input error in low light 2018-07-07 17:44:52 +02:00
vexpress-syscfg.c misc: vexpress: Off by one in vexpress_syscfg_exec() 2018-12-06 15:42:18 +01:00
vmw_balloon.c Char/Misc driver patches for 5.1-rc1 2019-03-06 14:18:59 -08:00