linux-xiaomi-chiron/drivers
Alexander Shishkin 0a8f72fafb stm class: Lose the protocol driver when dropping its reference
Commit c7fd62bc69 ("stm class: Introduce framing protocol drivers")
forgot to tear down the link between an stm device and its protocol
driver when policy is removed. This leads to an invalid pointer reference
if one tries to write to an stm device after the policy has been removed
and the protocol driver module unloaded, leading to the below splat:

> BUG: unable to handle page fault for address: ffffffffc0737068
> #PF: supervisor read access in kernel mode
> #PF: error_code(0x0000) - not-present page
> PGD 3d780f067 P4D 3d780f067 PUD 3d7811067 PMD 492781067 PTE 0
> Oops: 0000 [#1] SMP NOPTI
> CPU: 1 PID: 26122 Comm: cat Not tainted 5.4.0-rc5+ #1
> RIP: 0010:stm_output_free+0x40/0xc0 [stm_core]
> Call Trace:
>  stm_char_release+0x3e/0x70 [stm_core]
>  __fput+0xc6/0x260
>  ____fput+0xe/0x10
>  task_work_run+0x9d/0xc0
>  exit_to_usermode_loop+0x103/0x110
>  do_syscall_64+0x19d/0x1e0
>  entry_SYSCALL_64_after_hwframe+0x44/0xa9

Fix this by tearing down the link from an stm device to its protocol
driver when the policy involving that driver is removed.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Fixes: c7fd62bc69 ("stm class: Introduce framing protocol drivers")
Reported-by: Ammy Yi <ammy.yi@intel.com>
Tested-by: Ammy Yi <ammy.yi@intel.com>
CC: stable@vger.kernel.org # v4.20+
Link: https://lore.kernel.org/r/20191114064201.43089-2-alexander.shishkin@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-11-14 14:48:48 +08:00
..
accessibility
acpi
amba
android binder: Handle start==NULL in binder_update_page_range() 2019-11-14 11:44:47 +08:00
ata
atm
auxdisplay
base
bcma
block block: drbd: remove a stray unlock in __drbd_send_protocol() 2019-11-08 06:55:22 -07:00
bluetooth
bus
cdrom
char lp: fix sparc64 LPSETTIMEOUT ioctl 2019-11-13 19:08:22 +08:00
clk Fixes for various clk driver issues that happened because of code we 2019-11-08 08:15:01 -08:00
clocksource
connector
counter
cpufreq cpufreq: intel_pstate: Fix invalid EPB setting 2019-11-08 11:29:58 +01:00
cpuidle
crypto
dax
dca
devfreq
dio
dma
dma-buf
edac
eisa
extcon
firewire
firmware firmware: Fix incompatible function behavior for RSU driver 2019-11-14 13:11:32 +08:00
fpga
fsi fsi: aspeed: Fix OPB0 byte order register values 2019-11-08 11:28:21 +01:00
gnss
gpio Merge 5.4-rc7 into char-misc-next 2019-11-11 06:24:30 +01:00
gpu Merge tag 'drm-fixes-5.4-2019-11-06' of git://people.freedesktop.org/~agd5f/linux into drm-fixes 2019-11-08 13:07:58 +10:00
greybus
hid Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid 2019-11-07 11:54:54 -08:00
hsi
hv
hwmon
hwspinlock
hwtracing stm class: Lose the protocol driver when dropping its reference 2019-11-14 14:48:48 +08:00
i2c
i3c
ide
idle
iio Merge 5.4-rc7 into char-misc-next 2019-11-11 06:24:30 +01:00
infiniband
input
interconnect Merge 5.4-rc7 into char-misc-next 2019-11-11 06:24:30 +01:00
iommu
ipack
irqchip
isdn
leds
lightnvm
macintosh
mailbox
mcb
md
media
memory
memstick
message
mfd
misc misc: rtsx: Add support for RTS5261 2019-11-14 13:07:48 +08:00
mmc
mtd
mux
net Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-queue 2019-11-08 16:50:14 -08:00
nfc NFC: st21nfca: fix double free 2019-11-06 21:48:29 -08:00
ntb
nubus
nvdimm
nvme for-linus-2019-11-08 2019-11-08 18:15:55 -08:00
nvmem nvmem: add Rockchip OTP driver 2019-11-05 18:35:33 +01:00
of
opp
oprofile
parisc
parport parport: daisy: use new parport device model 2019-11-13 19:09:49 +08:00
pci
pcmcia pcmcia: include cs_internal.h for missing declarations 2019-11-14 12:22:11 +08:00
perf
phy
pinctrl pinctrl: stmfx: fix valid_mask init sequence 2019-11-07 10:06:46 +01:00
platform
pnp
power
powercap
pps
ps3
ptp
pwm pwm: bcm-iproc: Prevent unloading the driver module while in use 2019-11-08 18:38:06 +01:00
rapidio
ras
regulator
remoteproc
reset
rpmsg
rtc
s390
sbus
scsi
sfi
sh
siox
slimbus
soc
soundwire Merge 5.4-rc7 into char-misc-next 2019-11-11 06:24:30 +01:00
spi
spmi
ssb
staging staging: Fix error return code in vboxsf_fill_super() 2019-11-07 16:29:18 +01:00
target
tc
tee
thermal
thunderbolt
tty
uio uio: fix irq init with dt support & irq not defined 2019-11-14 11:49:48 +08:00
usb
vfio
vhost
video - Some new documentation for GEM shmem madvise helpers 2019-11-08 12:12:57 +10:00
virt
virtio
visorbus
vlynq
vme
w1 w1: new driver. DS2430 chip 2019-11-14 13:06:33 +08:00
watchdog Merge 5.4-rc7 into char-misc-next 2019-11-11 06:24:30 +01:00
xen
zorro
Kconfig
Makefile