kernel-fxtec-pro1x/drivers
Christian Brauner 45e4d11fa6 binderfs: use refcount for binder control devices too
Binderfs binder-control devices are cleaned up via binderfs_evict_inode
too() which will use refcount_dec_and_test(). However, we missed to set
the refcount for binderfs binder-control devices and so we underflowed
when the binderfs instance got unmounted. Pretty obvious oversight and
should have been part of the more general UAF fix. The good news is that
having test cases (suprisingly) helps.

Technically, we could detect that we're about to cleanup the
binder-control dentry in binderfs_evict_inode() and then simply clean it
up. But that makes the assumption that the binder driver itself will
never make use of a binderfs binder-control device after the binderfs
instance it belongs to has been unmounted and the superblock for it been
destroyed. While it is unlikely to ever come to this let's be on the
safe side. Performance-wise this also really doesn't matter since the
binder-control device is only every really when creating the binderfs
filesystem or creating additional binder devices. Both operations are
pretty rare.

Fixes: f0fe2c0f050d ("binder: prevent UAF for binderfs devices II")
Link: https://lore.kernel.org/r/CA+G9fYusdfg7PMfC9Xce-xLT7NiyKSbgojpK35GOm=Pf9jXXrA@mail.gmail.com
Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Cc: stable@vger.kernel.org
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Acked-by: Todd Kjos <tkjos@google.com>
Link: https://lore.kernel.org/r/20200311105309.1742827-1-christian.brauner@ubuntu.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-16 14:59:34 +02:00
..
accessibility
acpi This is the 4.19.156 stable release 2020-11-10 13:23:09 +01:00
amba
android binderfs: use refcount for binder control devices too 2023-01-16 14:59:34 +02:00
ata
atm
auxdisplay
base Import Pro1-X kernel source code 2022-03-20 00:13:44 +01:00
bcma
block
bluetooth Import Pro1-X kernel source code 2022-03-20 00:13:44 +01:00
bus Import Pro1-X kernel source code 2022-03-20 00:13:44 +01:00
cdrom
char Import Pro1-X kernel source code 2022-03-20 00:13:44 +01:00
clk Import Pro1-X kernel source code 2022-03-20 00:13:44 +01:00
clocksource Merge android-4.19-stable.149 (9ce79d9) into msm-4.19 2020-10-21 09:25:49 +05:30
connector
cpufreq Import Pro1-X kernel source code 2022-03-20 00:13:44 +01:00
cpuidle Import Pro1-X kernel source code 2022-03-20 00:13:44 +01:00
crypto Import Pro1-X kernel source code 2022-03-20 00:13:44 +01:00
dax
dca
devfreq Import Pro1-X kernel source code 2022-03-20 00:13:44 +01:00
dio
dma
dma-buf Import Pro1-X kernel source code 2022-03-20 00:13:44 +01:00
edac
eisa
energy_model
esoc
extcon
firewire
firmware
fmc
fpga
fsi
gnss
gpio Import Pro1-X kernel source code 2022-03-20 00:13:44 +01:00
gpu Import Pro1-X kernel source code 2022-03-20 00:13:44 +01:00
hid
hsi
hv
hwmon This is the 4.19.153 stable release 2020-10-29 11:36:20 +01:00
hwspinlock
hwtracing Import Pro1-X kernel source code 2022-03-20 00:13:44 +01:00
i2c Import F(x)tec Pro1-X BSP kernel changes as of 2022-06-01 2022-06-13 23:51:22 +03:00
i3c
ide
idle
iio iio: spmi-vadc: Add option to specify scale-fn-type in devicetree 2021-03-18 17:53:25 +05:30
infiniband
input drivers: aw9523: match the Pro1-X us layout, including support for function keys 2022-08-03 12:51:53 +03:00
iommu Import Pro1-X kernel source code 2022-03-20 00:13:44 +01:00
ipack
irqchip Import Pro1-X kernel source code 2022-03-20 00:13:44 +01:00
isdn
lastkmsg
leds leds: qpnp-flash-v2: Add support for dynamic torch current update 2021-11-17 10:31:42 +05:30
lightnvm
macintosh drivers/macintosh: Fix memleak in windfarm_pm112 driver 2020-06-22 09:05:29 +02:00
mailbox
mcb mcb: add Altera PCI ID to mcb-pci 2018-03-14 19:13:48 +01:00
md Import Pro1-X kernel source code 2022-03-20 00:13:44 +01:00
media Import Pro1-X kernel source code 2022-03-20 00:13:44 +01:00
memory memory: emif: Remove bogus debugfs error handling 2020-11-05 11:08:45 +01:00
memstick
message
mfd
misc Import F(x)tec Pro1-X BSP kernel changes as of 2022-06-01 2022-06-13 23:51:22 +03:00
mmc Import Pro1-X kernel source code 2022-03-20 00:13:44 +01:00
mtd
mux
net Import Pro1-X kernel source code 2022-03-20 00:13:44 +01:00
nfc Import Pro1-X kernel source code 2022-03-20 00:13:44 +01:00
ntb
nubus
nvdimm
nvme
nvmem
of Import Pro1-X kernel source code 2022-03-20 00:13:44 +01:00
opp Merge android-4.19.110 (1984fff) into msm-4.19 2020-05-23 05:08:22 -07:00
oprofile
parisc
parport
pci msm: pcie: Add ASM2806 PCIe device and vendor id 2021-08-08 18:32:11 -07:00
pcmcia
perf Import Pro1-X kernel source code 2022-03-20 00:13:44 +01:00
phy
pinctrl kernel: Merge LA.UM.9.15.r1-05300-KAMORTA.0 2022-06-11 03:14:24 +03:00
platform kernel: Merge LA.UM.9.15.r1-05300-KAMORTA.0 2022-06-11 03:14:24 +03:00
pnp
power HACK: Set “Mains” type for BMS and Main 2023-01-16 12:13:38 +02:00
powercap
pps drivers/pps/pps.c: clear offset flags in PPS_SETPARAMS ioctl 2019-08-04 09:30:56 +02:00
ps3
ptp
pwm
rapidio rapidio: fix the missed put_device() for rio_mport_add_riodev 2020-10-30 10:38:21 +01:00
ras
regulator regulator: qcom_pm8008-regulator: add support for PMIC PM8010 2021-09-15 00:01:52 -07:00
remoteproc
reset
rpmsg Import Pro1-X kernel source code 2022-03-20 00:13:44 +01:00
rtc Import Pro1-X kernel source code 2022-03-20 00:13:44 +01:00
s390 s390/zcrypt: Fix ZCRYPT_PERDEV_REQCNT ioctl 2020-10-01 13:14:54 +02:00
sbus
scsi Import Pro1-X kernel source code 2022-03-20 00:13:44 +01:00
sensors
sfi
sh
siox
slimbus
sn
soc kernel: Merge LA.UM.9.15.r1-05300-KAMORTA.0 2022-06-11 03:14:24 +03:00
soundwire
spi spi: spi-geni-qcom: Set IOEB for MHI on SPI RX only case 2021-04-15 19:32:24 +05:30
spmi Import Pro1-X kernel source code 2022-03-20 00:13:44 +01:00
ssb
staging kernel: Merge LA.UM.9.15.r1-02200-KAMORTA.0 2021-08-26 06:45:49 +02:00
switch
target
tc
tee
thermal Import Pro1-X kernel source code 2022-03-20 00:13:44 +01:00
thunderbolt
tty Import F(x)tec Pro1-X BSP kernel changes as of 2022-06-01 2022-06-13 23:51:22 +03:00
uio Import Pro1-X kernel source code 2022-03-20 00:13:44 +01:00
usb Import Pro1-X kernel source code 2022-03-20 00:13:44 +01:00
uwb
vfio
vhost This is the 4.19.155 stable release 2020-11-05 14:02:27 +01:00
video kernel: Merge LA.UM.9.15.r1-05300-KAMORTA.0 2022-06-11 03:14:24 +03:00
virt
virtio
visorbus
vlynq
vme
vservices
w1
watchdog
xen
zorro
Kconfig
Makefile