Dongliang Mu
64fa364ad3
fbdev: smscufx: fix error handling code in ufx_usb_probe
...
commit b76449ee75e21acfe9fa4c653d8598f191ed7d68 upstream.
The current error handling code in ufx_usb_probe have many unmatching
issues, e.g., missing ufx_free_usb_list, destroy_modedb label should
only include framebuffer_release, fb_dealloc_cmap only matches
fb_alloc_cmap.
My local syzkaller reports a memory leak bug:
memory leak in ufx_usb_probe
BUG: memory leak
unreferenced object 0xffff88802f879580 (size 128):
comm "kworker/0:7", pid 17416, jiffies 4295067474 (age 46.710s)
hex dump (first 32 bytes):
80 21 7c 2e 80 88 ff ff 18 d0 d0 0c 80 88 ff ff .!|.............
00 d0 d0 0c 80 88 ff ff e0 ff ff ff 0f 00 00 00 ................
backtrace:
[<ffffffff814c99a0>] kmalloc_trace+0x20/0x90 mm/slab_common.c:1045
[<ffffffff824d219c>] kmalloc include/linux/slab.h:553 [inline]
[<ffffffff824d219c>] kzalloc include/linux/slab.h:689 [inline]
[<ffffffff824d219c>] ufx_alloc_urb_list drivers/video/fbdev/smscufx.c:1873 [inline]
[<ffffffff824d219c>] ufx_usb_probe+0x11c/0x15a0 drivers/video/fbdev/smscufx.c:1655
[<ffffffff82d17927>] usb_probe_interface+0x177/0x370 drivers/usb/core/driver.c:396
[<ffffffff82712f0d>] call_driver_probe drivers/base/dd.c:560 [inline]
[<ffffffff82712f0d>] really_probe+0x12d/0x390 drivers/base/dd.c:639
[<ffffffff8271322f>] __driver_probe_device+0xbf/0x140 drivers/base/dd.c:778
[<ffffffff827132da>] driver_probe_device+0x2a/0x120 drivers/base/dd.c:808
[<ffffffff82713c27>] __device_attach_driver+0xf7/0x150 drivers/base/dd.c:936
[<ffffffff82710137>] bus_for_each_drv+0xb7/0x100 drivers/base/bus.c:427
[<ffffffff827136b5>] __device_attach+0x105/0x2d0 drivers/base/dd.c:1008
[<ffffffff82711d36>] bus_probe_device+0xc6/0xe0 drivers/base/bus.c:487
[<ffffffff8270e242>] device_add+0x642/0xdc0 drivers/base/core.c:3517
[<ffffffff82d14d5f>] usb_set_configuration+0x8ef/0xb80 drivers/usb/core/message.c:2170
[<ffffffff82d2576c>] usb_generic_driver_probe+0x8c/0xc0 drivers/usb/core/generic.c:238
[<ffffffff82d16ffc>] usb_probe_device+0x5c/0x140 drivers/usb/core/driver.c:293
[<ffffffff82712f0d>] call_driver_probe drivers/base/dd.c:560 [inline]
[<ffffffff82712f0d>] really_probe+0x12d/0x390 drivers/base/dd.c:639
[<ffffffff8271322f>] __driver_probe_device+0xbf/0x140 drivers/base/dd.c:778
Fix this bug by rewriting the error handling code in ufx_usb_probe.
Reported-by: syzkaller <syzkaller@googlegroups.com>
Tested-by: Dongliang Mu <dzm91@hust.edu.cn>
Signed-off-by: Dongliang Mu <dzm91@hust.edu.cn>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-02-09 11:26:47 +01:00
..
2021-06-03 10:32:49 +02:00
2023-02-09 11:26:41 +01:00
2022-12-31 13:14:32 +01:00
2020-05-06 19:29:10 +02:00
2020-01-30 08:04:01 -08:00
2021-07-26 20:06:00 +02:00
2023-01-12 11:59:17 +01:00
2021-06-03 10:32:49 +02:00
2020-12-08 18:34:25 +01:00
2022-04-08 14:23:59 +02:00
2021-02-18 15:14:32 +01:00
2023-01-24 07:22:42 +01:00
2021-07-26 20:06:03 +02:00
2020-09-08 13:33:15 +02:00
2022-08-17 14:24:11 +02:00
2022-12-31 13:14:32 +01:00
2022-12-31 13:14:31 +01:00
2020-01-03 14:27:43 +01:00
2021-02-24 13:38:31 -08:00
2019-06-19 17:09:55 +02:00
2022-08-17 14:24:11 +02:00
2021-02-12 10:01:45 +00:00
2021-07-21 13:09:21 +02:00
2022-08-17 14:24:16 +02:00
2021-07-26 20:05:50 +02:00
2022-04-08 14:23:00 +02:00
2022-04-08 14:23:14 +02:00
2019-12-05 10:57:53 +02:00
2019-06-03 16:00:08 +02:00
2019-12-05 10:57:53 +02:00
2019-12-05 10:57:53 +02:00
2020-12-08 18:34:08 +01:00
2020-03-09 11:12:19 +01:00
2020-01-30 08:04:01 -08:00
2020-12-08 18:34:08 +01:00
2020-12-08 18:34:08 +01:00
2020-01-15 17:31:50 +01:00
2022-09-15 11:30:01 +02:00
2022-04-08 14:24:00 +02:00
2019-12-05 10:57:53 +02:00
2019-12-05 10:57:53 +02:00
2022-04-08 14:23:14 +02:00
2019-05-30 11:26:32 -07:00
2020-09-08 13:33:16 +02:00
2019-06-19 17:09:55 +02:00
2021-02-12 10:01:45 +00:00
2019-12-05 10:57:53 +02:00
2022-05-18 10:26:49 +02:00
2022-12-31 13:14:32 +01:00
2020-12-08 18:34:08 +01:00
2019-12-05 10:57:53 +02:00
2020-10-17 08:23:14 +02:00
2020-02-19 10:58:22 -08:00
2021-10-06 11:12:28 +02:00
2020-12-08 18:34:50 +01:00
2020-07-20 11:47:29 +02:00
2020-08-23 17:36:59 -05:00
2019-12-05 10:57:53 +02:00
2021-05-21 15:04:05 +02:00
2020-06-09 09:39:13 -07:00
2020-06-17 10:57:41 -07:00
2022-12-31 13:14:39 +01:00
2022-09-23 14:15:49 +02:00
2021-05-13 18:58:39 +02:00
2021-05-07 18:34:18 +02:00
2022-12-31 13:14:32 +01:00
2020-12-08 18:34:08 +01:00
2020-07-20 11:47:29 +02:00
2020-10-15 10:46:16 -07:00
2019-12-05 10:57:53 +02:00
2020-07-20 11:47:29 +02:00
2020-11-30 20:04:56 +01:00
2021-07-21 15:02:03 +02:00
2020-01-03 14:27:49 +01:00
2020-08-23 17:36:59 -05:00
2020-12-08 18:34:08 +01:00
2019-12-05 10:57:53 +02:00
2022-12-31 13:14:31 +01:00
2020-07-16 12:35:15 -07:00
2020-01-30 08:04:01 -08:00
2020-01-30 08:04:01 -08:00
2020-01-30 08:04:01 -08:00
2020-12-04 01:01:22 +11:00
2020-08-05 19:47:22 +02:00
2022-09-23 14:15:51 +02:00
2020-08-23 17:36:59 -05:00
2020-08-23 17:36:59 -05:00
2019-08-26 10:02:02 +02:00
2020-06-09 09:39:13 -07:00
2020-11-29 22:51:07 +01:00
2020-08-20 17:48:12 +02:00
2020-08-20 17:48:12 +02:00
2020-12-05 21:01:04 +01:00
2022-08-17 14:24:16 +02:00
2020-08-23 17:36:59 -05:00
2020-04-17 15:50:11 +02:00
2020-09-25 16:34:50 +02:00
2020-01-30 08:04:01 -08:00
2020-11-01 10:29:04 +01:00
2019-06-12 20:28:11 +02:00
2022-05-18 10:26:48 +02:00
2019-12-05 10:57:53 +02:00
2020-08-23 17:36:59 -05:00
2022-04-08 14:24:02 +02:00
2023-02-09 11:26:47 +01:00
2021-07-27 17:18:26 +02:00
2020-11-30 20:04:59 +01:00
2022-06-09 10:22:26 +02:00
2022-11-10 18:15:32 +01:00
2019-12-05 10:57:53 +02:00
2019-12-05 10:57:53 +02:00
2019-12-05 10:57:53 +02:00
2020-12-08 18:34:08 +01:00
2020-11-30 20:04:30 +01:00
2020-11-30 20:04:50 +01:00
2019-12-05 10:57:53 +02:00
2020-01-30 08:04:01 -08:00
2022-05-09 09:14:31 +02:00
2022-12-31 13:14:32 +01:00
2020-05-06 21:04:45 +02:00
2019-05-30 11:26:32 -07:00
2022-06-09 10:23:16 +02:00
2019-12-05 10:57:53 +02:00
2022-01-20 09:13:14 +01:00
2020-04-17 15:50:08 +02:00
2019-06-05 17:36:37 +02:00
2022-08-17 14:24:16 +02:00
2022-04-08 14:23:59 +02:00
2019-06-19 17:09:55 +02:00
2019-06-05 17:36:37 +02:00
2020-03-02 16:32:04 +01:00
2020-12-08 18:34:36 +01:00
2020-08-23 17:36:59 -05:00
2021-07-13 13:58:29 -05:00