kernel_samsung_a53x/drivers/hid
WangYuli 021598cbdb HID: wacom: fix when get product name maybe null pointer
commit 59548215b76be98cf3422eea9a67d6ea578aca3d upstream.

Due to incorrect dev->product reporting by certain devices, null
pointer dereferences occur when dev->product is empty, leading to
potential system crashes.

This issue was found on EXCELSIOR DL37-D05 device with
Loongson-LS3A6000-7A2000-DL37 motherboard.

Kernel logs:
[   56.470885] usb 4-3: new full-speed USB device number 4 using ohci-pci
[   56.671638] usb 4-3: string descriptor 0 read error: -22
[   56.671644] usb 4-3: New USB device found, idVendor=056a, idProduct=0374, bcdDevice= 1.07
[   56.671647] usb 4-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   56.678839] hid-generic 0003:056A:0374.0004: hiddev0,hidraw3: USB HID v1.10 Device [HID 056a:0374] on usb-0000:00:05.0-3/input0
[   56.697719] CPU 2 Unable to handle kernel paging request at virtual address 0000000000000000, era == 90000000066e35c8, ra == ffff800004f98a80
[   56.697732] Oops[#1]:
[   56.697734] CPU: 2 PID: 2742 Comm: (udev-worker) Tainted: G           OE      6.6.0-loong64-desktop #25.00.2000.015
[   56.697737] Hardware name: Inspur CE520L2/C09901N000000000, BIOS 2.09.00 10/11/2024
[   56.697739] pc 90000000066e35c8 ra ffff800004f98a80 tp 9000000125478000 sp 900000012547b8a0
[   56.697741] a0 0000000000000000 a1 ffff800004818b28 a2 0000000000000000 a3 0000000000000000
[   56.697743] a4 900000012547b8f0 a5 0000000000000000 a6 0000000000000000 a7 0000000000000000
[   56.697745] t0 ffff800004818b2d t1 0000000000000000 t2 0000000000000003 t3 0000000000000005
[   56.697747] t4 0000000000000000 t5 0000000000000000 t6 0000000000000000 t7 0000000000000000
[   56.697748] t8 0000000000000000 u0 0000000000000000 s9 0000000000000000 s0 900000011aa48028
[   56.697750] s1 0000000000000000 s2 0000000000000000 s3 ffff800004818e80 s4 ffff800004810000
[   56.697751] s5 90000001000b98d0 s6 ffff800004811f88 s7 ffff800005470440 s8 0000000000000000
[   56.697753]    ra: ffff800004f98a80 wacom_update_name+0xe0/0x300 [wacom]
[   56.697802]   ERA: 90000000066e35c8 strstr+0x28/0x120
[   56.697806]  CRMD: 000000b0 (PLV0 -IE -DA +PG DACF=CC DACM=CC -WE)
[   56.697816]  PRMD: 0000000c (PPLV0 +PIE +PWE)
[   56.697821]  EUEN: 00000000 (-FPE -SXE -ASXE -BTE)
[   56.697827]  ECFG: 00071c1d (LIE=0,2-4,10-12 VS=7)
[   56.697831] ESTAT: 00010000 [PIL] (IS= ECode=1 EsubCode=0)
[   56.697835]  BADV: 0000000000000000
[   56.697836]  PRID: 0014d000 (Loongson-64bit, Loongson-3A6000)
[   56.697838] Modules linked in: wacom(+) bnep bluetooth rfkill qrtr nls_iso8859_1 nls_cp437 snd_hda_codec_conexant snd_hda_codec_generic ledtrig_audio snd_hda_codec_hdmi snd_hda_intel snd_intel_dspcfg snd_hda_codec snd_hda_core snd_hwdep snd_pcm snd_timer snd soundcore input_leds mousedev led_class joydev deepin_netmonitor(OE) fuse nfnetlink dmi_sysfs ip_tables x_tables overlay amdgpu amdxcp drm_exec gpu_sched drm_buddy radeon drm_suballoc_helper i2c_algo_bit drm_ttm_helper r8169 ttm drm_display_helper spi_loongson_pci xhci_pci cec xhci_pci_renesas spi_loongson_core hid_generic realtek gpio_loongson_64bit
[   56.697887] Process (udev-worker) (pid: 2742, threadinfo=00000000aee0d8b4, task=00000000a9eff1f3)
[   56.697890] Stack : 0000000000000000 ffff800004817e00 0000000000000000 0000251c00000000
[   56.697896]         0000000000000000 00000011fffffffd 0000000000000000 0000000000000000
[   56.697901]         0000000000000000 1b67a968695184b9 0000000000000000 90000001000b98d0
[   56.697906]         90000001000bb8d0 900000011aa48028 0000000000000000 ffff800004f9d74c
[   56.697911]         90000001000ba000 ffff800004f9ce58 0000000000000000 ffff800005470440
[   56.697916]         ffff800004811f88 90000001000b98d0 9000000100da2aa8 90000001000bb8d0
[   56.697921]         0000000000000000 90000001000ba000 900000011aa48028 ffff800004f9d74c
[   56.697926]         ffff8000054704e8 90000001000bb8b8 90000001000ba000 0000000000000000
[   56.697931]         90000001000bb8d0 9000000006307564 9000000005e666e0 90000001752359b8
[   56.697936]         9000000008cbe400 900000000804d000 9000000005e666e0 0000000000000000
[   56.697941]         ...
[   56.697944] Call Trace:
[   56.697945] [<90000000066e35c8>] strstr+0x28/0x120
[   56.697950] [<ffff800004f98a80>] wacom_update_name+0xe0/0x300 [wacom]
[   56.698000] [<ffff800004f9ce58>] wacom_parse_and_register+0x338/0x900 [wacom]
[   56.698050] [<ffff800004f9d74c>] wacom_probe+0x32c/0x420 [wacom]
[   56.698099] [<9000000006307564>] hid_device_probe+0x144/0x260
[   56.698103] [<9000000005e65d68>] really_probe+0x208/0x540
[   56.698109] [<9000000005e661dc>] __driver_probe_device+0x13c/0x1e0
[   56.698112] [<9000000005e66620>] driver_probe_device+0x40/0x100
[   56.698116] [<9000000005e6680c>] __device_attach_driver+0x12c/0x180
[   56.698119] [<9000000005e62bc8>] bus_for_each_drv+0x88/0x160
[   56.698123] [<9000000005e66468>] __device_attach+0x108/0x260
[   56.698126] [<9000000005e63918>] device_reprobe+0x78/0x100
[   56.698129] [<9000000005e62a68>] bus_for_each_dev+0x88/0x160
[   56.698132] [<9000000006304e54>] __hid_bus_driver_added+0x34/0x80
[   56.698134] [<9000000005e62bc8>] bus_for_each_drv+0x88/0x160
[   56.698137] [<9000000006304df0>] __hid_register_driver+0x70/0xa0
[   56.698142] [<9000000004e10fe4>] do_one_initcall+0x104/0x320
[   56.698146] [<9000000004f38150>] do_init_module+0x90/0x2c0
[   56.698151] [<9000000004f3a3d8>] init_module_from_file+0xb8/0x120
[   56.698155] [<9000000004f3a590>] idempotent_init_module+0x150/0x3a0
[   56.698159] [<9000000004f3a890>] sys_finit_module+0xb0/0x140
[   56.698163] [<900000000671e4e8>] do_syscall+0x88/0xc0
[   56.698166] [<9000000004e12404>] handle_syscall+0xc4/0x160
[   56.698171] Code: 0011958f  00150224  5800cd85 <2a00022c> 00150004  4000c180  0015022c  03400000  03400000
[   56.698192] ---[ end trace 0000000000000000 ]---

Fixes: 09dc28acaec7 ("HID: wacom: Improve generic name generation")
Reported-by: Zhenxing Chen <chenzhenxing@uniontech.com>
Co-developed-by: Xu Rao <raoxu@uniontech.com>
Signed-off-by: Xu Rao <raoxu@uniontech.com>
Signed-off-by: WangYuli <wangyuli@uniontech.com>
Link: https://patch.msgid.link/B31757FE8E1544CF+20241125052616.18261-1-wangyuli@uniontech.com
Cc: stable@vger.kernel.org
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-12-17 13:24:28 +01:00
..
i2c-hid HID: i2c-hid: remove I2C_HID_READ_PENDING flag to prevent lock-up 2024-11-19 11:32:40 +01:00
intel-ish-hid Revert "hid: intel-ish-hid: Fix uninitialized variable 'rv' in ish_fw_xfer_direct_dma" 2024-11-24 00:22:55 +01:00
usbhid Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-a4tech.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-accutouch.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-alps.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-apple.c HID: apple: Add 2021 magic keyboard FN key mapping 2024-11-18 12:13:23 +01:00
hid-appleir.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-asus.c HID: hid-asus: add const to read-only outgoing usb buffer 2024-11-18 12:11:57 +01:00
hid-aureal.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-axff.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-belkin.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-betopff.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-bigbenff.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-cherry.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-chicony.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-cmedia.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-core.c HID: core: zero-initialize the report buffer 2024-11-30 02:33:21 +01:00
hid-corsair.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-cougar.c Revert "HID: cougar: fix slab-out-of-bounds Read in cougar_report_fixup" 2024-11-24 00:23:39 +01:00
hid-cp2112.c hid: cp2112: Fix IRQ shutdown stopping polling for all IRQs on chip 2024-11-18 11:43:04 +01:00
hid-creative-sb0540.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-cypress.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-debug.c HID: fix HID device resource race between HID core and debugging support 2024-11-18 12:10:54 +01:00
hid-dr.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-elan.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-elecom.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-elo.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-emsff.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-ezkey.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-gaff.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-gembird.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-generic.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-gfrm.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-glorious.c HID: glorious: fix Glorious Model I HID report 2024-11-18 12:11:56 +01:00
hid-google-hammer.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-gt683r.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-gyration.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-holtek-kbd.c HID: holtek: fix slab-out-of-bounds Write in holtek_kbd_input_event 2024-11-08 11:26:16 +01:00
hid-holtek-mouse.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-holtekff.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-hyperv.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-icade.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-ids.h Revert "HID: plantronics: Workaround for an unexcepted opposite volume key" 2024-11-24 00:22:55 +01:00
hid-input.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-ite.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-jabra.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-kensington.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-keytouch.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-kye.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-lcpower.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-led.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-lenovo.c HID: lenovo: Add middleclick_workaround sysfs knob for cptkbd 2024-11-19 08:44:51 +01:00
hid-lg-g15.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-lg.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-lg.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-lg2ff.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-lg3ff.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-lg4ff.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-lg4ff.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-lgff.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-logitech-dj.c HID: logitech-dj: Fix memory leak in logi_dj_recv_switch_to_dj_mode() 2024-11-19 14:19:03 +01:00
hid-logitech-hidpp.c HID: logitech-hidpp: Move get_wireless_feature_index() check to hidpp_connect_event() 2024-11-18 11:43:04 +01:00
hid-macally.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-magicmouse.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-maltron.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-mcp2221.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-mf.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-microsoft.c HID: microsoft: Add rumble support to latest xbox controllers 2024-11-23 23:20:49 +01:00
hid-monterey.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-multitouch.c HID: multitouch: Add quirk for HONOR MagicBook Art 14 touchpad 2024-11-30 02:33:27 +01:00
hid-nintendo.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-nti.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-ntrig.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-ortek.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-penmount.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-petalynx.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-picolcd.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-picolcd_backlight.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-picolcd_cir.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-picolcd_core.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-picolcd_debugfs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-picolcd_fb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-picolcd_lcd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-picolcd_leds.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-pl.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-plantronics.c Revert "HID: plantronics: Workaround for an unexcepted opposite volume key" 2024-11-24 00:22:55 +01:00
hid-playstation.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-primax.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-prodikeys.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-quirks.c HID: apple: Add support for the 2021 Magic Keyboard 2024-11-18 12:13:23 +01:00
hid-redragon.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-retrode.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-rmi.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-roccat-arvo.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-roccat-arvo.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-roccat-common.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-roccat-common.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-roccat-isku.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-roccat-isku.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-roccat-kone.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-roccat-kone.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-roccat-koneplus.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-roccat-koneplus.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-roccat-konepure.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-roccat-kovaplus.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-roccat-kovaplus.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-roccat-lua.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-roccat-lua.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-roccat-pyra.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-roccat-pyra.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-roccat-ryos.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-roccat-savu.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-roccat-savu.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-roccat.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-saitek.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-samsung.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-sensor-custom.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-sensor-hub.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-sjoy.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-sony.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-speedlink.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-steam.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-steelseries.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-sunplus.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-tivo.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-tmff.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-topseed.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-twinhan.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-u2fzero.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-uclogic-core.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-uclogic-params.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-uclogic-params.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-uclogic-rdesc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-uclogic-rdesc.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-udraw-ps3.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-viewsonic.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-vivaldi.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-waltop.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-wiimote-core.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-wiimote-debug.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-wiimote-modules.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-wiimote.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-xinmo.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-zpff.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid-zydacron.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hidraw.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
uhid.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
wacom.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
wacom_sys.c HID: wacom: fix when get product name maybe null pointer 2024-12-17 13:24:28 +01:00
wacom_wac.c HID: wacom: Interpret tilt data from Intuos Pro BT as signed values 2024-12-17 13:24:19 +01:00
wacom_wac.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00