linux/drivers
Karthik Alapati a5623a203c HID: hidraw: fix memory leak in hidraw_release()
Free the buffered reports before deleting the list entry.

BUG: memory leak
unreferenced object 0xffff88810e72f180 (size 32):
  comm "softirq", pid 0, jiffies 4294945143 (age 16.080s)
  hex dump (first 32 bytes):
    64 f3 c6 6a d1 88 07 04 00 00 00 00 00 00 00 00  d..j............
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<ffffffff814ac6c3>] kmemdup+0x23/0x50 mm/util.c:128
    [<ffffffff8357c1d2>] kmemdup include/linux/fortify-string.h:440 [inline]
    [<ffffffff8357c1d2>] hidraw_report_event+0xa2/0x150 drivers/hid/hidraw.c:521
    [<ffffffff8356ddad>] hid_report_raw_event+0x27d/0x740 drivers/hid/hid-core.c:1992
    [<ffffffff8356e41e>] hid_input_report+0x1ae/0x270 drivers/hid/hid-core.c:2065
    [<ffffffff835f0d3f>] hid_irq_in+0x1ff/0x250 drivers/hid/usbhid/hid-core.c:284
    [<ffffffff82d3c7f9>] __usb_hcd_giveback_urb+0xf9/0x230 drivers/usb/core/hcd.c:1670
    [<ffffffff82d3cc26>] usb_hcd_giveback_urb+0x1b6/0x1d0 drivers/usb/core/hcd.c:1747
    [<ffffffff82ef1e14>] dummy_timer+0x8e4/0x14c0 drivers/usb/gadget/udc/dummy_hcd.c:1988
    [<ffffffff812f50a8>] call_timer_fn+0x38/0x200 kernel/time/timer.c:1474
    [<ffffffff812f5586>] expire_timers kernel/time/timer.c:1519 [inline]
    [<ffffffff812f5586>] __run_timers.part.0+0x316/0x430 kernel/time/timer.c:1790
    [<ffffffff812f56e4>] __run_timers kernel/time/timer.c:1768 [inline]
    [<ffffffff812f56e4>] run_timer_softirq+0x44/0x90 kernel/time/timer.c:1803
    [<ffffffff848000e6>] __do_softirq+0xe6/0x2ea kernel/softirq.c:571
    [<ffffffff81246db0>] invoke_softirq kernel/softirq.c:445 [inline]
    [<ffffffff81246db0>] __irq_exit_rcu kernel/softirq.c:650 [inline]
    [<ffffffff81246db0>] irq_exit_rcu+0xc0/0x110 kernel/softirq.c:662
    [<ffffffff84574f02>] sysvec_apic_timer_interrupt+0xa2/0xd0 arch/x86/kernel/apic/apic.c:1106
    [<ffffffff84600c8b>] asm_sysvec_apic_timer_interrupt+0x1b/0x20 arch/x86/include/asm/idtentry.h:649
    [<ffffffff8458a070>] native_safe_halt arch/x86/include/asm/irqflags.h:51 [inline]
    [<ffffffff8458a070>] arch_safe_halt arch/x86/include/asm/irqflags.h:89 [inline]
    [<ffffffff8458a070>] acpi_safe_halt drivers/acpi/processor_idle.c:111 [inline]
    [<ffffffff8458a070>] acpi_idle_do_entry+0xc0/0xd0 drivers/acpi/processor_idle.c:554

Link: https://syzkaller.appspot.com/bug?id=19a04b43c75ed1092021010419b5e560a8172c4f
Reported-by: syzbot+f59100a0428e6ded9443@syzkaller.appspotmail.com
Signed-off-by: Karthik Alapati <mail@karthek.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2022-08-25 11:30:50 +02:00
..
accessibility speakup: Generate speakupmap.h automatically 2022-06-27 15:15:55 +02:00
acpi Driver core / kernfs changes for 6.0-rc1 2022-08-04 11:31:20 -07:00
amba ARM: 9220/1: amba: Remove deferred device addition 2022-07-28 15:09:23 +01:00
android binder: fix redefinition of seq_file attributes 2022-07-08 15:44:19 +02:00
ata ATA changes for 5.20-rc1 2022-08-03 15:26:04 -07:00
atm atm: he: Use the bitmap API to allocate bitmaps 2022-07-11 19:49:53 -07:00
auxdisplay
base Driver core / kernfs changes for 6.0-rc1 2022-08-04 11:31:20 -07:00
bcma
block for-5.20/block-2022-07-29 2022-08-02 13:46:35 -07:00
bluetooth SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
bus SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
cdrom block: remove blk_cleanup_disk 2022-06-28 06:33:15 -06:00
char SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
clk SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
clocksource - Add the missing DT bindings for the MTU nomadik timer (Linus 2022-07-28 12:33:34 +02:00
comedi
connector
counter counter: 104-quad-8: Implement and utilize register structures 2022-07-14 19:17:41 +02:00
cpufreq SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
cpuidle SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
crypto This update includes the following changes: 2022-08-02 17:45:14 -07:00
cxl cxl/mbox: Fix missing variable payload checks in cmd size validation 2022-06-28 22:03:18 -07:00
dax
dca
devfreq Char / Misc driver changes for 6.0-rc1 2022-08-04 11:05:48 -07:00
dio
dma Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/egtvedt/linux-avr32 2022-08-04 15:20:39 -07:00
dma-buf drm for 5.20/6.0 2022-08-03 19:52:08 -07:00
edac SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
eisa
extcon extcon: Add EXTCON_DISP_CVBS and EXTCON_DISP_EDP 2022-07-15 11:37:41 +09:00
firewire firewire: net: Make use of get_unaligned_be48(), put_unaligned_be48() 2022-07-28 22:21:54 -07:00
firmware Char / Misc driver changes for 6.0-rc1 2022-08-04 11:05:48 -07:00
fpga fpga: fpga-mgr: Fix spelling mistake "bitsream" -> "bitstream" 2022-06-29 15:18:18 +08:00
fsi
gnss
gpio SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
gpu drm/amd/amdgpu: fix build failure due to implicit declaration 2022-08-04 12:29:10 -07:00
greybus
hid HID: hidraw: fix memory leak in hidraw_release() 2022-08-25 11:30:50 +02:00
hsi
hte
hv
hwmon hwmon updates for v5.20 2022-08-02 11:07:04 -07:00
hwspinlock
hwtracing CoreSight self-hosted tracing changes for v5.20. 2022-07-11 20:54:28 +02:00
i2c SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
i3c
idle Power management updates for 5.20-rc1 2022-08-02 11:17:00 -07:00
iio iio: light: isl29028: Fix the warning in isl29028_remove() 2022-07-19 09:42:11 +01:00
infiniband Networking changes for 6.0. 2022-08-03 16:29:08 -07:00
input SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
interconnect Merge branch 'icc-rpm' into icc-next 2022-07-15 17:56:31 +03:00
iommu Driver core / kernfs changes for 6.0-rc1 2022-08-04 11:31:20 -07:00
ipack
irqchip SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
isdn
leds
macintosh
mailbox
mcb drivers: mcb: directly use ida_alloc()/free() 2022-07-12 09:04:55 +02:00
md hardening updates for v5.20-rc1 2022-08-02 14:38:59 -07:00
media SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
memory SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
memstick block: remove blk_cleanup_disk 2022-06-28 06:33:15 -06:00
message
mfd Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/egtvedt/linux-avr32 2022-08-04 15:20:39 -07:00
misc Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/egtvedt/linux-avr32 2022-08-04 15:20:39 -07:00
mmc SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
most
mtd for-5.20/block-2022-07-29 2022-08-02 13:46:35 -07:00
mux
net Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/egtvedt/linux-avr32 2022-08-04 15:20:39 -07:00
nfc NFC: nxp-nci: add error reporting 2022-07-13 18:52:12 -07:00
ntb
nubus
nvdimm for-5.20/block-2022-07-29 2022-08-02 13:46:35 -07:00
nvme iov_iter work, part 1 - isolated cleanups and optimizations. 2022-08-03 13:50:22 -07:00
nvmem SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
of Driver core / kernfs changes for 6.0-rc1 2022-08-04 11:31:20 -07:00
opp PM: EM: convert power field to micro-Watts precision and align drivers 2022-07-15 19:17:30 +02:00
parisc genirq: Add and use an irq_data_update_affinity helper 2022-07-07 09:38:04 +01:00
parport
pci PCI: hv: Take a const cpumask in hv_compose_msi_req_get_cpu() 2022-07-08 08:44:15 +01:00
pcmcia
peci
perf drivers/perf: arm_spe: Fix consistency of SYS_PMSCR_EL1.CX 2022-07-19 18:50:09 +01:00
phy SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
pinctrl SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
platform Merge branch 'acpi-bus' 2022-07-29 19:58:52 +02:00
pnp
power SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
powercap Power management updates for 5.20-rc1 2022-08-02 11:17:00 -07:00
pps
ps3
ptp SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
pwm SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
rapidio
ras
regulator SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
remoteproc Revert "devcoredump: remove the useless gfp_t parameter in dev_coredumpv and dev_coredumpm" 2022-06-27 16:39:29 +02:00
reset SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
rpmsg
rtc
s390 ARM: 2022-08-04 14:59:54 -07:00
sbus
scsi SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
sh genirq: Add and use an irq_data_update_affinity helper 2022-07-07 09:38:04 +01:00
siox
slimbus slimbus: messaging: fix typos in comments 2022-07-08 15:43:42 +02:00
soc SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
soundwire Char / Misc driver changes for 6.0-rc1 2022-08-04 11:05:48 -07:00
spi Driver core / kernfs changes for 6.0-rc1 2022-08-04 11:31:20 -07:00
spmi
ssb
staging Staging driver patches for 6.0-rc1 2022-08-04 12:01:42 -07:00
target for-5.20/block-2022-07-29 2022-08-02 13:46:35 -07:00
tc
tee tee: tee_get_drvdata(): fix description of return value 2022-07-08 10:51:24 +02:00
thermal SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
thunderbolt USB / Thunderbolt changes for 6.0-rc1 2022-08-04 11:41:28 -07:00
tty ARM: SoC drivers for 6.0 2022-08-02 08:10:10 -07:00
ufs for-5.20/block-2022-07-29 2022-08-02 13:46:35 -07:00
uio
usb Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/egtvedt/linux-avr32 2022-08-04 15:20:39 -07:00
vdpa vduse: Tie vduse mgmtdev and its device 2022-06-24 02:49:48 -04:00
vfio ARM: 2022-08-04 14:59:54 -07:00
vhost vhost-vdpa: call vhost_vdpa_cleanup during the release 2022-06-27 08:05:35 -04:00
video Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/egtvedt/linux-avr32 2022-08-04 15:20:39 -07:00
virt Char / Misc driver changes for 6.0-rc1 2022-08-04 11:05:48 -07:00
virtio xen: branch for v6.0-rc1 2022-08-04 15:10:55 -07:00
vlynq
w1
watchdog
xen xen: branch for v6.0-rc1 2022-08-04 15:10:55 -07:00
zorro
Kconfig
Makefile Staging driver patches for 6.0-rc1 2022-08-04 12:01:42 -07:00