Patch "drm/amdkfd: Fix shift out-of-bounds issue" has been added to the 6.6-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    drm/amdkfd: Fix shift out-of-bounds issue

to the 6.6-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     drm-amdkfd-fix-shift-out-of-bounds-issue.patch
and it can be found in the queue-6.6 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit b0827aefd226628d511d81dd68224c8277225b59
Author: Jesse Zhang <jesse.zhang@xxxxxxx>
Date:   Fri Oct 20 09:43:51 2023 +0800

    drm/amdkfd: Fix shift out-of-bounds issue
    
    [ Upstream commit 282c1d793076c2edac6c3db51b7e8ed2b41d60a5 ]
    
    [  567.613292] shift exponent 255 is too large for 64-bit type 'long unsigned int'
    [  567.614498] CPU: 5 PID: 238 Comm: kworker/5:1 Tainted: G           OE      6.2.0-34-generic #34~22.04.1-Ubuntu
    [  567.614502] Hardware name: AMD Splinter/Splinter-RPL, BIOS WS43927N_871 09/25/2023
    [  567.614504] Workqueue: events send_exception_work_handler [amdgpu]
    [  567.614748] Call Trace:
    [  567.614750]  <TASK>
    [  567.614753]  dump_stack_lvl+0x48/0x70
    [  567.614761]  dump_stack+0x10/0x20
    [  567.614763]  __ubsan_handle_shift_out_of_bounds+0x156/0x310
    [  567.614769]  ? srso_alias_return_thunk+0x5/0x7f
    [  567.614773]  ? update_sd_lb_stats.constprop.0+0xf2/0x3c0
    [  567.614780]  svm_range_split_by_granularity.cold+0x2b/0x34 [amdgpu]
    [  567.615047]  ? srso_alias_return_thunk+0x5/0x7f
    [  567.615052]  svm_migrate_to_ram+0x185/0x4d0 [amdgpu]
    [  567.615286]  do_swap_page+0x7b6/0xa30
    [  567.615291]  ? srso_alias_return_thunk+0x5/0x7f
    [  567.615294]  ? __free_pages+0x119/0x130
    [  567.615299]  handle_pte_fault+0x227/0x280
    [  567.615303]  __handle_mm_fault+0x3c0/0x720
    [  567.615311]  handle_mm_fault+0x119/0x330
    [  567.615314]  ? lock_mm_and_find_vma+0x44/0x250
    [  567.615318]  do_user_addr_fault+0x1a9/0x640
    [  567.615323]  exc_page_fault+0x81/0x1b0
    [  567.615328]  asm_exc_page_fault+0x27/0x30
    [  567.615332] RIP: 0010:__get_user_8+0x1c/0x30
    
    Signed-off-by: Jesse Zhang <jesse.zhang@xxxxxxx>
    Suggested-by: Philip Yang <Philip.Yang@xxxxxxx>
    Reviewed-by: Yifan Zhang <yifan1.zhang@xxxxxxx>
    Signed-off-by: Alex Deucher <alexander.deucher@xxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
index 2591bdfcc2289..63ce30ea68915 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
@@ -767,7 +767,7 @@ svm_range_apply_attrs(struct kfd_process *p, struct svm_range *prange,
 			prange->flags &= ~attrs[i].value;
 			break;
 		case KFD_IOCTL_SVM_ATTR_GRANULARITY:
-			prange->granularity = attrs[i].value;
+			prange->granularity = min_t(uint32_t, attrs[i].value, 0x3F);
 			break;
 		default:
 			WARN_ONCE(1, "svm_range_check_attrs wasn't called?");



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux