android_kernel_xiaomi_sm8450/drivers
Prashanth K 6a8037d4eb UPSTREAM: usb: gadget: u_serial: Add null pointer check in gserial_resume
Consider a case where gserial_disconnect has already cleared
gser->ioport. And if a wakeup interrupt triggers afterwards,
gserial_resume gets called, which will lead to accessing of
gser->ioport and thus causing null pointer dereference.Add
a null pointer check to prevent this.

Added a static spinlock to prevent gser->ioport from becoming
null after the newly added check.

Fixes: aba3a8d01d ("usb: gadget: u_serial: add suspend resume callbacks")
Cc: stable <stable@kernel.org>
Signed-off-by: Prashanth K <quic_prashk@quicinc.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/1676309438-14922-1-git-send-email-quic_prashk@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 270271430
(cherry picked from commit 5ec63fdbca604568890c577753c6f66c5b3ef0b5
https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git/ usb-next)

Change-Id: Ib54ccfc7921fd399d538d93d13d6fe8beef0fb39
Signed-off-by: Prashanth K <quic_prashk@quicinc.com>
2023-02-22 12:34:00 +05:30
..
accessibility speakup: fix a segfault caused by switching consoles 2022-11-25 17:45:50 +01:00
acpi This is the 5.10.158 stable release 2022-12-08 16:39:44 +00:00
amba
android ANDROID: dma-ops: Add restricted vendor hook 2023-02-09 18:53:48 +00:00
ata ata: libata-core: do not issue non-internal commands once EH is pending 2022-12-02 17:39:57 +01:00
atm atm: idt77252: fix use-after-free bugs caused by tst_timer 2022-08-25 11:38:02 +02:00
auxdisplay
base Merge tag 'android12-5.10.160_r00' into android12-5.10 2023-01-21 12:06:54 +00:00
bcma
block This is the 5.10.156 stable release 2022-12-02 08:42:05 +00:00
bluetooth This is the 5.10.159 stable release 2022-12-14 13:11:31 +01:00
bus bus: sunxi-rsb: Support atomic transfers 2022-12-02 17:39:59 +01:00
cdrom
char This is the 5.10.158 stable release 2022-12-08 16:39:44 +00:00
clk Merge tag 'android12-5.10.160_r00' into android12-5.10 2023-01-21 12:06:54 +00:00
clocksource This is the 5.10.158 stable release 2022-12-08 16:39:44 +00:00
connector
counter counter: microchip-tcb-capture: Handle Signal1 read and Synapse 2022-11-03 23:57:50 +09:00
cpufreq This is the 5.10.152 stable release 2022-11-21 15:46:22 +00:00
cpuidle ANDROID: cpuidle-psci: Fix suspicious RCU usage 2023-02-09 18:20:25 +00:00
crypto This is the 5.10.150 stable release 2022-11-15 19:14:08 +00:00
dax devdax: Fix soft-reservation memory description 2022-09-28 11:10:41 +02:00
dca
devfreq PM / devfreq: exynos-ppmu: Fix refcount leak in of_get_devfreq_events 2022-07-07 17:52:18 +02:00
dio
dma dmaengine: at_hdmac: Check return code of dma_async_device_register 2022-11-16 09:57:20 +01:00
dma-buf Merge tag 'android12-5.10.160_r00' into android12-5.10 2023-01-21 12:06:54 +00:00
edac EDAC/ghes: Set the DIMM label unconditionally 2022-08-03 12:00:50 +02:00
eisa
extcon extcon: Modify extcon device to be created after driver data is set 2022-06-14 18:32:43 +02:00
firewire
firmware UPSTREAM: firmware: tegra: Reduce stack usage 2023-01-26 11:34:37 +00:00
fpga fpga: prevent integer overflow in dfl_feature_ioctl_set_irq() 2022-10-26 13:25:33 +02:00
fsi fsi: core: Check error number after calling ida_simple_get 2022-10-26 13:25:38 +02:00
gnss
gpio This is the 5.10.159 stable release 2022-12-14 13:11:31 +01:00
gpu This is the 5.10.159 stable release 2022-12-14 13:11:31 +01:00
greybus
hid UPSTREAM: HID: uclogic: Add HID_QUIRK_HIDINPUT_FORCE quirk 2023-02-06 11:31:43 +00:00
hsi HSI: omap_ssi_port: Fix dma_map_sg error check 2022-10-26 13:25:32 +02:00
hv Drivers: hv: vmbus: fix possible memory leak in vmbus_device_register() 2022-12-02 17:40:00 +01:00
hwmon This is the 5.10.158 stable release 2022-12-08 16:39:44 +00:00
hwspinlock hwspinlock: qcom: correct MMIO max register for newer SoCs 2022-11-16 09:57:07 +01:00
hwtracing This is the 5.10.154 stable release 2022-11-29 23:38:14 +00:00
i2c This is the 5.10.158 stable release 2022-12-08 16:39:44 +00:00
i3c
ide
idle intel_idle: Disable IBRS during long idle 2022-07-25 11:26:43 +02:00
iio iio: light: rpr0521: add missing Kconfig dependencies 2022-12-08 11:23:54 +01:00
infiniband This is the 5.10.154 stable release 2022-11-29 23:38:14 +00:00
input Input: raydium_ts_i2c - fix memory leak in raydium_i2c_send() 2022-12-08 11:23:59 +01:00
interconnect This is the 5.10.146 stable release 2022-09-29 17:06:30 +02:00
iommu BACKPORT: iommu: Avoid races around device probe 2023-02-17 16:22:47 +00:00
ipack
irqchip Merge tag 'android12-5.10.160_r00' into android12-5.10 2023-01-21 12:06:54 +00:00
isdn mISDN: fix misuse of put_device() in mISDN_register_device() 2022-11-25 17:45:46 +01:00
leds leds: lm3601x: Don't use mutex after it was destroyed 2022-10-26 13:25:18 +02:00
lightnvm
macintosh macintosh/adb: fix oob read in do_adb_query() function 2022-08-11 13:06:47 +02:00
mailbox This is the 5.10.150 stable release 2022-11-15 19:14:08 +00:00
mcb
md Merge tag 'android12-5.10.160_r00' into android12-5.10 2023-01-21 12:06:54 +00:00
media UPSTREAM: media: dvb-core: Fix UAF due to refcount races at releasing 2023-01-31 17:48:42 +00:00
memory This is the 5.10.150 stable release 2022-11-15 19:14:08 +00:00
memstick memstick/ms_block: Fix a memory leak 2022-08-21 15:15:58 +02:00
message
mfd mtd: spi-nor: intel-spi: Disable write protection only if asked 2022-11-25 17:45:41 +01:00
misc This is the 5.10.156 stable release 2022-12-02 08:42:05 +00:00
mmc Revert "mmc: sdhci: Fix voltage switch delay" 2022-12-12 17:47:03 +00:00
most
mtd This is the 5.10.156 stable release 2022-12-02 08:42:05 +00:00
mux
net UPSTREAM: net: loopback: use NET_NAME_PREDICTABLE for name_assign_type 2023-02-06 11:31:47 +00:00
nfc nfc: st-nci: fix memory leaks in EVT_TRANSACTION 2022-12-02 17:40:02 +01:00
ntb NTB: ntb_tool: uninitialized heap data in tool_fn_write() 2022-08-25 11:38:01 +02:00
nubus
nvdimm nvdimm: Fix badblocks clear off-by-one error 2022-07-07 17:52:15 +02:00
nvme This is the 5.10.160 stable release 2022-12-20 12:38:28 +00:00
nvmem
of This is the 5.10.158 stable release 2022-12-08 16:39:44 +00:00
opp This is the 5.10.137 stable release 2022-08-29 16:53:14 +02:00
oprofile
parisc parisc: Export iosapic_serial_irq() symbol for serial port driver 2022-11-10 18:14:27 +01:00
parport parport_pc: Avoid FIFO port location truncation 2022-11-25 17:45:44 +01:00
pci This is the 5.10.150 stable release 2022-11-15 19:14:08 +00:00
pcmcia pcmcia: db1xxx_ss: restrict to MIPS_DB1XXX boards 2022-06-14 18:32:30 +02:00
perf perf/arm_pmu_platform: fix tests for platform_get_irq() failure 2022-09-20 12:38:32 +02:00
phy phy: stm32: fix an error code in probe 2022-11-16 09:57:08 +01:00
pinctrl This is the 5.10.160 stable release 2022-12-20 12:38:28 +00:00
platform This is the 5.10.157 stable release 2022-12-04 12:51:21 +00:00
pnp
power This is the 5.10.150 stable release 2022-11-15 19:14:08 +00:00
powercap This is the 5.10.150 stable release 2022-11-15 19:14:08 +00:00
pps
ps3
ptp
pwm This is the 5.10.137 stable release 2022-08-29 16:53:14 +02:00
rapidio
ras
regulator Merge tag 'android12-5.10.160_r00' into android12-5.10 2023-01-21 12:06:54 +00:00
remoteproc UPSTREAM: remoteproc: core: Fix rproc->firmware free in rproc_set_firmware() 2023-01-25 18:48:50 +00:00
reset This is the 5.10.147 stable release 2022-10-05 18:33:23 +02:00
rpmsg This is the 5.10.148 stable release 2022-10-15 08:33:43 +02:00
rtc rtc: mc146818-lib: fix signedness bug in mc146818_get_time() 2022-12-14 11:31:59 +01:00
s390 This is the 5.10.157 stable release 2022-12-04 12:51:21 +00:00
sbus
scsi UPSTREAM: scsi: bfa: Move a large struct from the stack onto the heap 2023-01-26 11:34:37 +00:00
sfi
sh
siox siox: fix possible memory leak in siox_device_add() 2022-11-25 17:45:44 +01:00
slimbus slimbus: stream: correct presence rate frequencies 2022-11-25 17:45:50 +01:00
soc This is the 5.10.150 stable release 2022-11-15 19:14:08 +00:00
soundwire soundwire: intel: fix error handling on dai registration issues 2022-10-26 13:25:53 +02:00
spi This is the 5.10.158 stable release 2022-12-08 16:39:44 +00:00
spmi spmi: pmic-arb: correct duplicate APID to PPID mapping logic 2022-10-26 13:25:39 +02:00
ssb
staging This is the 5.10.154 stable release 2022-11-29 23:38:14 +00:00
target This is the 5.10.156 stable release 2022-12-02 08:42:05 +00:00
tc
tee tee: optee: fix possible memory leak in optee_register_device() 2022-12-02 17:39:59 +01:00
thermal This is the 5.10.150 stable release 2022-11-15 19:14:08 +00:00
thunderbolt thunderbolt: Explicitly enable lane adapter hotplug events at startup 2022-10-26 13:25:16 +02:00
tty This is the 5.10.158 stable release 2022-12-08 16:39:44 +00:00
uio
usb UPSTREAM: usb: gadget: u_serial: Add null pointer check in gserial_resume 2023-02-22 12:34:00 +05:30
vdpa vdpasim: allow to enable a vq repeatedly 2022-06-09 10:21:29 +02:00
vfio vfio/type1: fix vaddr_get_pfns() return in vfio_pin_page_external() 2022-09-28 11:10:38 +02:00
vhost This is the 5.10.150 stable release 2022-11-15 19:14:08 +00:00
video This is the 5.10.159 stable release 2022-12-14 13:11:31 +01:00
virt vboxguest: Do not use devm for irq 2022-08-25 11:38:14 +02:00
virtio ANDROID: fix up 5.10.132 merge with the virtio_mmio.c driver 2022-07-30 17:39:01 +02:00
visorbus
vlynq
vme
w1
watchdog watchdog: armada_37xx_wdt: check the return value of devm_ioremap() in armada_37xx_wdt_probe() 2022-08-21 15:16:10 +02:00
xen xen/platform-pci: add missing free_irq() in error path 2022-12-02 17:40:05 +01:00
zorro
Kconfig
Makefile