Noralf Trønnes
951df98024
drm/gud: Fix UBSAN warning
...
UBSAN complains about invalid value for bool:
[ 101.165172] [drm] Initialized gud 1.0.0 20200422 for 2-3.2:1.0 on minor 1
[ 101.213360] gud 2-3.2:1.0: [drm] fb1: guddrmfb frame buffer device
[ 101.213426] usbcore: registered new interface driver gud
[ 101.989431] ================================================================================
[ 101.989441] UBSAN: invalid-load in linux/include/linux/iosys-map.h:253:9
[ 101.989447] load of value 121 is not a valid value for type '_Bool'
[ 101.989451] CPU: 1 PID: 455 Comm: kworker/1:6 Not tainted 5.18.0-rc5-gud-5.18-rc5 #3
[ 101.989456] Hardware name: Hewlett-Packard HP EliteBook 820 G1/1991, BIOS L71 Ver. 01.44 04/12/2018
[ 101.989459] Workqueue: events_long gud_flush_work [gud]
[ 101.989471] Call Trace:
[ 101.989474] <TASK>
[ 101.989479] dump_stack_lvl+0x49/0x5f
[ 101.989488] dump_stack+0x10/0x12
[ 101.989493] ubsan_epilogue+0x9/0x3b
[ 101.989498] __ubsan_handle_load_invalid_value.cold+0x44/0x49
[ 101.989504] dma_buf_vmap.cold+0x38/0x3d
[ 101.989511] ? find_busiest_group+0x48/0x300
[ 101.989520] drm_gem_shmem_vmap+0x76/0x1b0 [drm_shmem_helper]
[ 101.989528] drm_gem_shmem_object_vmap+0x9/0xb [drm_shmem_helper]
[ 101.989535] drm_gem_vmap+0x26/0x60 [drm]
[ 101.989594] drm_gem_fb_vmap+0x47/0x150 [drm_kms_helper]
[ 101.989630] gud_prep_flush+0xc1/0x710 [gud]
[ 101.989639] ? _raw_spin_lock+0x17/0x40
[ 101.989648] gud_flush_work+0x1e0/0x430 [gud]
[ 101.989653] ? __switch_to+0x11d/0x470
[ 101.989664] process_one_work+0x21f/0x3f0
[ 101.989673] worker_thread+0x200/0x3e0
[ 101.989679] ? rescuer_thread+0x390/0x390
[ 101.989684] kthread+0xfd/0x130
[ 101.989690] ? kthread_complete_and_exit+0x20/0x20
[ 101.989696] ret_from_fork+0x22/0x30
[ 101.989706] </TASK>
[ 101.989708] ================================================================================
The source of this warning is in iosys_map_clear() called from
dma_buf_vmap(). It conditionally sets values based on map->is_iomem. The
iosys_map variables are allocated uninitialized on the stack leading to
->is_iomem having all kinds of values and not only 0/1.
Fix this by zeroing the iosys_map variables.
Fixes: 40e1a70b4aed ("drm: Add GUD USB Display driver")
Cc: <stable@vger.kernel.org> # v5.18+
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20221122-gud-shadow-plane-v2-1-435037990a83@tronnes.org
2022-12-06 16:34:57 +01:00
..
2022-12-06 12:54:14 +01:00
2022-11-16 10:33:45 +00:00
2022-11-05 17:05:54 +01:00
2022-11-05 17:12:04 +01:00
2022-11-05 17:12:04 +01:00
2022-11-05 17:12:04 +01:00
2022-12-01 09:38:45 +01:00
2022-11-24 11:05:43 +10:00
2022-11-22 12:30:01 +10:00
2022-11-05 17:05:54 +01:00
2022-11-05 17:12:04 +01:00
2022-11-05 17:05:54 +01:00
2022-12-06 16:34:57 +01:00
2022-11-24 14:07:52 +01:00
2022-11-05 17:12:04 +01:00
2022-11-24 12:42:39 +01:00
2022-12-06 12:54:14 +01:00
2022-11-24 11:05:43 +10:00
2022-11-05 17:12:04 +01:00
2022-11-05 17:12:04 +01:00
2022-11-24 11:05:43 +10:00
2022-11-24 14:07:52 +01:00
2022-11-05 17:12:04 +01:00
2022-11-12 01:41:35 +02:00
2022-12-01 09:38:48 +01:00
2022-11-05 17:12:04 +01:00
2022-11-24 11:05:43 +10:00
2022-11-25 22:47:34 +01:00
2022-12-06 12:54:14 +01:00
2022-11-11 23:49:47 +03:00
2022-12-05 13:36:16 +01:00
2022-11-24 11:05:43 +10:00
2022-11-05 17:12:04 +01:00
2022-12-06 12:54:14 +01:00
2022-12-06 12:54:14 +01:00
2022-11-24 11:05:43 +10:00
2022-11-24 11:05:43 +10:00
2022-11-24 09:28:05 +01:00
2022-09-20 09:37:12 +02:00
2022-07-28 15:35:56 +01:00
2022-11-24 14:07:52 +01:00
2022-08-03 18:32:27 +02:00
2022-11-12 01:41:35 +02:00
2022-11-05 17:12:04 +01:00
2022-11-24 12:42:41 +01:00
2022-11-24 11:05:43 +10:00
2022-12-01 11:13:24 +01:00
2022-11-05 17:12:04 +01:00
2022-11-05 17:12:04 +01:00
2022-12-05 14:21:18 +01:00
2022-12-06 13:02:20 +01:00
2022-11-05 17:12:04 +01:00
2022-11-05 17:12:04 +01:00
2022-11-10 11:49:40 -01:00
2022-11-05 17:12:04 +01:00
2022-12-01 11:13:56 +01:00
2022-09-07 07:01:16 +02:00
2022-11-05 17:12:04 +01:00
2022-11-29 22:10:48 -01:00
2022-12-06 12:54:14 +01:00
2022-11-05 17:12:04 +01:00
2022-11-16 07:17:32 +10:00
2022-09-12 09:34:07 +02:00
2022-11-08 17:10:27 +01:00
2022-11-24 12:42:40 +01:00
2022-11-24 12:42:39 +01:00
2022-11-28 11:46:50 +01:00
2022-07-28 15:35:55 +01:00
2022-06-28 07:56:32 +02:00
2022-06-21 08:52:59 -07:00
2022-07-08 13:41:28 +02:00
2022-11-24 12:42:40 +01:00
2022-11-02 13:53:57 +03:00
2022-08-04 15:24:46 +02:00
2022-11-24 12:42:39 +01:00
2022-11-05 17:12:04 +01:00
2022-10-26 09:53:56 +03:00
2022-07-13 10:46:05 +02:00
2022-09-13 14:38:33 +03:00
2022-10-26 09:53:08 +03:00
2022-11-10 18:49:01 -05:00
2022-11-16 14:54:44 +02:00
2022-11-22 09:21:17 +10:00
2022-07-13 10:46:05 +02:00
2022-08-03 18:32:27 +02:00
2022-11-20 11:23:26 +01:00
2022-11-24 14:07:52 +01:00
2022-09-06 10:56:04 +02:00
2022-11-24 11:05:43 +10:00
2022-11-23 20:34:46 +01:00
2022-09-28 10:43:30 +02:00
2022-12-05 13:35:37 +01:00
2022-10-18 01:21:38 +03:00
2022-11-05 17:12:04 +01:00
2022-11-21 16:55:52 +01:00
2022-12-06 12:54:14 +01:00
2022-12-06 12:54:14 +01:00
2022-11-21 16:55:52 +01:00
2022-11-10 18:49:02 -05:00
2022-07-15 10:25:36 +02:00
2022-06-20 23:53:55 +03:00
2022-12-05 14:21:18 +01:00
2022-10-24 09:26:56 +02:00
2022-11-21 17:01:16 +01:00
2022-12-01 11:12:44 +01:00
2022-09-20 09:42:31 +02:00
2022-07-05 21:15:13 +03:00
2022-11-08 10:12:45 +01:00
2022-10-13 09:17:05 +02:00
2022-09-20 09:41:06 +02:00
2022-11-11 23:49:47 +03:00
2022-09-24 15:02:02 +02:00
2022-11-24 12:42:40 +01:00
2022-10-24 09:27:04 +02:00
2022-12-05 13:35:37 +01:00
2022-06-20 23:53:55 +03:00
2022-11-22 13:41:11 +10:00
2022-11-16 13:26:12 +01:00