Arunpravin Paneer Selvam
239a310b49
drm/amdgpu: Fix out-of-bounds issue in user fence
Fix out-of-bounds issue in userq fence create when
accessing the userq xa structure. Added a lock to
protect the race condition.
v2:(Christian)
- Allocate memory with GFP_ATOMIC.
v3:
- Moved to 2 xa approach.
v4:(Christian)
- Lock the xa_for_each blocks and memory allocation part
as well to make sure that xa is not modified in between
the 2 xa_for_each blocks.
BUG: KASAN: slab-out-of-bounds in amdgpu_userq_fence_create+0x726/0x880 [amdgpu]
[ +0.000006] Call Trace:
[ +0.000005] <TASK>
[ +0.000005] dump_stack_lvl+0x6c/0x90
[ +0.000011] print_report+0xc4/0x5e0
[ +0.000009] ? srso_return_thunk+0x5/0x5f
[ +0.000008] ? kasan_complete_mode_report_info+0x26/0x1d0
[ +0.000007] ? amdgpu_userq_fence_create+0x726/0x880 [amdgpu]
[ +0.000405] kasan_report+0xdf/0x120
[ +0.000009] ? amdgpu_userq_fence_create+0x726/0x880 [amdgpu]
[ +0.000405] __asan_report_store8_noabort+0x17/0x20
[ +0.000007] amdgpu_userq_fence_create+0x726/0x880 [amdgpu]
[ +0.000406] ? __pfx_amdgpu_userq_fence_create+0x10/0x10 [amdgpu]
[ +0.000408] ? srso_return_thunk+0x5/0x5f
[ +0.000008] ? ttm_resource_move_to_lru_tail+0x235/0x4f0 [ttm]
[ +0.000013] ? srso_return_thunk+0x5/0x5f
[ +0.000008] amdgpu_userq_signal_ioctl+0xd29/0x1c70 [amdgpu]
[ +0.000412] ? __pfx_amdgpu_userq_signal_ioctl+0x10/0x10 [amdgpu]
[ +0.000404] ? try_to_wake_up+0x165/0x1840
[ +0.000010] ? __pfx_futex_wake_mark+0x10/0x10
[ +0.000011] drm_ioctl_kernel+0x178/0x2f0 [drm]
[ +0.000050] ? __pfx_amdgpu_userq_signal_ioctl+0x10/0x10 [amdgpu]
[ +0.000404] ? __pfx_drm_ioctl_kernel+0x10/0x10 [drm]
[ +0.000043] ? __kasan_check_read+0x11/0x20
[ +0.000007] ? srso_return_thunk+0x5/0x5f
[ +0.000007] ? __kasan_check_write+0x14/0x20
[ +0.000008] drm_ioctl+0x513/0xd20 [drm]
[ +0.000040] ? __pfx_amdgpu_userq_signal_ioctl+0x10/0x10 [amdgpu]
[ +0.000407] ? __pfx_drm_ioctl+0x10/0x10 [drm]
[ +0.000044] ? srso_return_thunk+0x5/0x5f
[ +0.000007] ? _raw_spin_lock_irqsave+0x99/0x100
[ +0.000007] ? __pfx__raw_spin_lock_irqsave+0x10/0x10
[ +0.000006] ? __rseq_handle_notify_resume+0x188/0xc30
[ +0.000008] ? srso_return_thunk+0x5/0x5f
[ +0.000008] ? srso_return_thunk+0x5/0x5f
[ +0.000006] ? _raw_spin_unlock_irqrestore+0x27/0x50
[ +0.000010] amdgpu_drm_ioctl+0xcd/0x1d0 [amdgpu]
[ +0.000388] __x64_sys_ioctl+0x135/0x1b0
[ +0.000009] x64_sys_call+0x1205/0x20d0
[ +0.000007] do_syscall_64+0x4d/0x120
[ +0.000008] entry_SYSCALL_64_after_hwframe+0x76/0x7e
[ +0.000007] RIP: 0033:0x7f7c3d31a94f
Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2025-04-08 16:48:20 -04:00
..
2024-12-10 10:26:46 -05:00
2025-03-26 17:44:41 -04:00
2025-03-26 17:44:41 -04:00
2025-02-25 11:43:58 -05:00
2025-03-05 10:42:42 -05:00
2024-04-30 09:44:34 -04:00
2025-03-13 23:10:38 -04:00
2025-03-13 23:10:38 -04:00
2025-03-13 23:10:38 -04:00
2025-03-13 23:10:38 -04:00
2025-03-13 23:10:38 -04:00
2025-03-13 23:10:38 -04:00
2025-03-13 23:10:38 -04:00
2025-03-13 23:10:38 -04:00
2025-03-05 10:47:26 -05:00
2025-03-05 10:47:26 -05:00
2025-03-21 12:15:08 -04:00
2025-02-25 11:45:12 -05:00
2025-02-25 11:45:12 -05:00
2025-02-12 21:02:54 -05:00
2025-02-12 21:02:54 -05:00
2025-02-17 14:09:29 -05:00
2024-09-26 17:06:24 -04:00
2024-04-26 17:22:38 -04:00
2025-03-26 17:46:33 -04:00
2025-04-07 15:18:34 -04:00
2025-01-07 12:45:19 +02:00
2024-05-23 14:37:24 +03:00
2025-04-08 16:48:14 -04:00
2025-02-17 14:09:30 -05:00
2025-03-21 12:16:34 -04:00
2024-02-16 15:41:50 -05:00
2024-08-13 13:03:57 -04:00
2025-03-13 23:12:52 -04:00
2025-02-25 11:44:00 -05:00
2024-08-29 13:38:53 -04:00
2025-04-08 16:48:16 -04:00
2024-07-24 17:30:23 -04:00
2025-04-07 14:32:20 -04:00
2024-10-01 17:40:07 -04:00
2024-12-18 12:13:49 -05:00
2024-12-18 12:13:49 -05:00
2025-04-07 15:18:30 -04:00
2025-04-08 16:48:20 -04:00
2024-12-05 12:35:42 +02:00
2024-11-04 11:33:24 -05:00
2024-05-20 16:20:26 -04:00
2025-04-08 16:48:19 -04:00
2025-04-08 16:48:19 -04:00
2024-12-19 16:56:28 +01:00
2024-06-19 14:17:25 -04:00
2025-02-25 11:44:00 -05:00
2024-12-10 10:26:51 -05:00
2025-01-14 11:06:50 -05:00
2024-11-04 12:05:30 -05:00
2024-08-16 14:23:16 -04:00
2025-04-08 16:48:20 -04:00
2024-09-18 16:15:13 -04:00
2025-04-07 15:18:34 -04:00
2025-04-08 16:48:17 -04:00
2024-08-23 10:53:16 -04:00
2025-04-07 15:18:30 -04:00
2025-02-27 16:50:04 -05:00
2024-06-14 16:15:58 -04:00
2024-05-13 15:44:02 -04:00
2025-02-12 21:02:54 -05:00
2025-02-12 21:02:54 -05:00
2025-01-24 09:55:04 -05:00
2025-03-21 12:16:34 -04:00
2025-03-21 12:16:34 -04:00
2024-12-18 12:39:07 -05:00
2025-03-07 12:53:30 -05:00
2024-06-27 17:34:40 -04:00
2025-02-25 11:43:58 -05:00
2025-02-27 15:52:49 -05:00
2025-03-21 12:16:34 -04:00
2024-08-20 22:06:43 -04:00
2025-02-12 21:03:01 -05:00
2025-02-12 21:03:01 -05:00
2025-04-08 16:48:18 -04:00
2024-10-28 16:41:26 -04:00
2024-06-19 12:50:31 -04:00
2025-04-08 16:48:19 -04:00
2025-04-08 16:48:16 -04:00
2024-08-23 10:53:16 -04:00
2025-02-12 21:02:54 -05:00
2024-02-22 10:21:27 -05:00
2024-10-15 11:17:25 -04:00
2025-04-07 14:30:57 -04:00
2025-01-09 15:48:50 +10:00
2024-09-06 17:38:53 -04:00
2024-11-21 15:56:22 -05:00
2024-08-20 23:04:17 -04:00
2025-03-21 12:15:08 -04:00
2025-04-07 15:18:58 -04:00
2025-04-08 16:48:14 -04:00
2025-03-18 14:03:38 -04:00
2025-04-08 16:48:14 -04:00
2025-03-26 17:44:34 -04:00
2024-04-22 19:44:16 +02:00
2024-12-10 10:27:50 -05:00
2024-11-20 10:03:05 -05:00
2024-08-16 14:17:31 -04:00
2025-03-26 17:45:42 -04:00
2025-03-21 12:16:35 -04:00
2024-05-02 16:18:10 -04:00
2024-12-18 12:17:32 -05:00
2024-11-03 01:28:06 -05:00
2025-04-07 15:18:59 -04:00
2025-03-21 12:16:35 -04:00
2024-05-08 15:17:04 -04:00
2025-04-08 16:48:20 -04:00
2025-04-08 16:48:17 -04:00
2024-03-20 13:38:16 -04:00
2025-03-21 12:16:36 -04:00
2025-03-21 12:16:34 -04:00
2025-03-21 12:16:34 -04:00
2025-02-25 11:45:12 -05:00
2025-02-03 12:11:36 -05:00
2025-02-12 21:05:49 -05:00
2025-04-07 15:18:58 -04:00
2025-02-12 21:02:56 -05:00
2025-02-25 11:45:12 -05:00
2025-02-17 14:09:02 -05:00
2024-05-13 15:45:41 -04:00
2025-04-08 16:48:20 -04:00
2025-04-08 16:48:17 -04:00
2025-04-08 16:48:20 -04:00
2024-12-10 10:26:51 -05:00
2024-12-18 12:17:32 -05:00
2025-04-07 15:18:31 -04:00
2025-03-19 15:54:36 -04:00
2025-04-07 18:00:40 -04:00
2025-04-07 15:18:58 -04:00
2025-02-25 11:43:58 -05:00
2024-09-10 13:44:29 -04:00
2025-02-12 21:05:49 -05:00
2024-09-18 16:15:06 -04:00
2024-03-20 13:38:14 -04:00
2025-03-21 12:16:34 -04:00
2025-02-12 21:05:50 -05:00
2024-12-18 12:17:32 -05:00
2024-11-08 11:45:29 -05:00
2025-04-07 15:18:30 -04:00
2024-04-22 19:44:16 +02:00
2025-01-14 11:06:50 -05:00
2024-11-04 12:06:23 -05:00
2025-04-07 15:18:59 -04:00
2025-02-27 16:50:04 -05:00
2025-04-08 16:48:19 -04:00
2025-04-07 15:18:58 -04:00
2025-03-26 17:44:32 -04:00
2024-02-12 16:08:12 -05:00
2024-02-12 16:08:12 -05:00
2024-10-02 17:23:23 -04:00
2025-01-07 12:45:19 +02:00
2025-01-07 12:45:19 +02:00
2024-08-27 14:33:12 +02:00
2025-02-25 11:43:58 -05:00
2025-04-07 15:18:32 -04:00
2025-02-25 11:43:58 -05:00
2025-04-07 15:18:32 -04:00
2024-05-02 16:18:10 -04:00
2025-02-25 11:43:58 -05:00
2025-04-08 16:48:13 -04:00
2025-04-08 16:48:13 -04:00
2025-04-08 16:48:13 -04:00
2025-04-08 16:48:13 -04:00
2024-05-08 15:17:07 -04:00
2024-11-21 15:56:22 -05:00
2024-07-24 17:30:23 -04:00
2024-07-24 17:30:23 -04:00
2025-04-07 15:18:34 -04:00
2025-04-07 15:18:34 -04:00
2025-04-07 15:18:34 -04:00
2024-10-22 17:50:39 -04:00
2025-04-07 18:01:08 -04:00
2024-10-22 17:50:39 -04:00
2024-12-18 12:17:32 -05:00
2024-08-20 22:07:16 -04:00
2024-08-20 22:07:16 -04:00
2025-04-07 18:01:08 -04:00
2025-02-12 21:04:06 -05:00
2025-02-12 21:02:59 -05:00
2025-04-08 16:05:07 -04:00
2025-02-12 21:02:59 -05:00
2025-01-06 14:44:28 -05:00
2024-11-05 10:33:56 -05:00
2024-08-06 11:11:01 -04:00
2024-11-05 10:33:56 -05:00
2025-04-08 16:48:19 -04:00
2024-08-16 14:24:56 -04:00
2025-04-08 16:48:19 -04:00
2024-12-11 17:32:13 -05:00
2025-03-05 10:47:21 -05:00
2025-02-12 21:03:00 -05:00
2025-03-13 23:10:08 -04:00
2024-07-08 16:46:36 -04:00
2024-04-30 10:00:30 -04:00
2025-04-08 16:48:14 -04:00
2025-04-07 15:18:32 -04:00
2025-02-25 11:43:58 -05:00
2025-04-07 15:18:59 -04:00
2025-02-25 11:43:58 -05:00
2025-02-25 11:43:58 -05:00
2025-03-13 23:18:02 -04:00
2024-04-30 10:00:39 -04:00
2025-02-12 21:04:06 -05:00
2025-02-12 21:04:06 -05:00
2025-02-12 21:04:06 -05:00
2025-02-12 21:04:06 -05:00
2025-02-12 21:04:06 -05:00
2024-02-12 16:09:57 -05:00
2025-02-25 11:43:58 -05:00
2025-02-25 11:43:58 -05:00
2025-02-25 11:43:58 -05:00
2025-02-25 11:43:58 -05:00
2024-02-12 16:09:42 -05:00
2025-02-12 21:02:55 -05:00
2024-12-10 10:26:51 -05:00
2024-05-02 16:18:11 -04:00
2025-02-27 15:52:49 -05:00
2025-02-27 15:52:49 -05:00
2025-02-27 15:52:49 -05:00
2025-02-27 15:52:49 -05:00
2025-02-27 15:52:29 -05:00
2024-10-01 17:40:43 -04:00
2025-02-25 11:43:58 -05:00
2024-09-10 17:26:49 -04:00
2025-02-25 11:43:58 -05:00
2025-02-25 11:43:58 -05:00
2025-03-26 17:44:41 -04:00
2025-03-05 10:38:01 -05:00
2025-02-25 11:43:58 -05:00
2025-02-25 11:43:58 -05:00
2024-09-10 17:26:49 -04:00
2025-02-25 11:43:58 -05:00
2024-06-27 17:34:33 -04:00
2025-03-05 10:47:36 -05:00
2025-03-05 10:37:56 -05:00
2025-04-08 16:48:16 -04:00
2024-02-12 16:08:41 -05:00
2024-02-12 16:08:41 -05:00
2025-04-08 16:48:19 -04:00
2025-04-08 16:48:19 -04:00
2025-04-08 16:48:19 -04:00
2025-04-08 16:48:16 -04:00
2025-04-08 16:48:16 -04:00
2024-05-02 16:18:10 -04:00
2024-12-10 10:26:47 -05:00
2025-02-12 21:05:49 -05:00
2025-04-07 15:18:58 -04:00
2024-06-14 16:17:12 -04:00
2025-02-12 21:02:55 -05:00
2024-12-18 12:22:22 -05:00
2024-04-30 09:58:25 -04:00
2025-02-12 21:05:49 -05:00
2024-06-27 17:31:37 -04:00
2024-06-27 17:31:37 -04:00
2025-03-05 10:47:03 -05:00
2025-03-05 10:46:40 -05:00
2024-06-14 16:15:58 -04:00
2025-02-25 11:43:58 -05:00
2024-10-01 17:39:38 -04:00
2025-02-25 11:44:01 -05:00
2025-02-25 11:44:01 -05:00
2025-02-12 21:04:06 -05:00
2025-02-12 21:04:06 -05:00
2025-02-12 21:04:06 -05:00
2025-02-12 21:04:06 -05:00
2025-02-12 21:04:06 -05:00
2025-02-12 21:04:06 -05:00
2025-02-12 21:04:06 -05:00
2025-02-12 21:04:06 -05:00
2025-02-12 21:04:06 -05:00
2025-03-13 23:08:51 -04:00
2025-02-12 21:03:00 -05:00
2024-10-07 14:32:00 -04:00
2025-02-12 21:05:49 -05:00
2025-04-07 15:18:58 -04:00
2025-02-12 21:02:55 -05:00
2024-02-14 17:16:07 -05:00
2025-02-25 11:43:58 -05:00
2025-02-25 11:43:58 -05:00
2025-02-25 11:43:58 -05:00
2025-03-26 17:44:47 -04:00
2025-02-25 11:43:58 -05:00
2024-08-13 10:26:53 -04:00
2025-02-25 11:43:58 -05:00
2024-08-13 10:26:59 -04:00
2024-06-14 15:22:14 -04:00
2025-04-08 16:48:19 -04:00
2025-04-08 16:48:19 -04:00
2024-04-30 10:03:32 -04:00
2025-04-07 15:18:33 -04:00
2025-04-07 15:18:34 -04:00
2025-04-07 15:18:32 -04:00
2025-04-08 16:48:14 -04:00
2025-04-08 16:48:14 -04:00
2024-11-20 10:03:05 -05:00
2024-11-20 10:03:05 -05:00
2024-09-18 16:14:26 -04:00
2024-03-20 13:38:16 -04:00
2024-03-20 13:38:16 -04:00
2025-04-07 15:18:31 -04:00
2024-07-27 17:28:28 -04:00
2025-02-12 21:03:00 -05:00
2025-03-13 23:08:51 -04:00
2025-02-25 11:43:58 -05:00
2024-04-30 09:46:51 -04:00
2025-03-26 17:44:34 -04:00
2024-12-10 10:26:49 -05:00
2025-02-25 11:43:58 -05:00
2024-03-20 13:38:15 -04:00
2024-12-10 10:28:39 -05:00
2024-12-10 10:28:39 -05:00
2025-04-08 16:48:14 -04:00
2025-04-08 16:48:14 -04:00
2024-05-23 15:09:35 -04:00
2025-03-05 10:37:13 -05:00
2025-03-05 10:37:13 -05:00
2025-02-25 11:43:58 -05:00
2025-02-25 11:43:58 -05:00
2024-12-10 10:26:47 -05:00
2025-03-10 13:36:21 -04:00
2025-02-25 11:43:58 -05:00
2024-12-10 10:26:47 -05:00
2025-02-27 16:50:05 -05:00
2025-02-27 16:50:05 -05:00
2025-03-19 15:56:09 -04:00
2025-02-27 16:50:05 -05:00
2025-04-08 16:48:14 -04:00
2025-03-05 10:37:35 -05:00
2025-04-07 15:18:59 -04:00
2025-02-27 15:52:31 -05:00
2025-02-27 16:50:05 -05:00
2024-12-11 17:37:13 -05:00
2025-03-05 10:46:33 -05:00
2025-03-05 10:37:31 -05:00
2025-02-25 11:43:58 -05:00
2025-03-26 17:44:47 -04:00
2025-02-25 11:43:58 -05:00
2025-03-13 23:08:25 -04:00
2024-08-16 14:24:09 -04:00
2024-03-07 15:32:58 -05:00
2024-07-02 18:06:24 -04:00