Patch "drm/xe: Fix potential integer overflow in page size calculation" has been added to the 6.9-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/xe: Fix potential integer overflow in page size calculation

to the 6.9-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-xe-fix-potential-integer-overflow-in-page-size-c.patch
and it can be found in the queue-6.9 subdirectory.

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



commit 9aed6248f72c8bce02b159e960ebe09aaa2c07ff
Author: Nirmoy Das <nirmoy.das@xxxxxxxxx>
Date:   Mon Mar 18 17:43:41 2024 +0100

    drm/xe: Fix potential integer overflow in page size calculation
    
    [ Upstream commit 4f4fcafde343a54465f85a2909fc684918507a4b ]
    
    Explicitly cast tbo->page_alignment to u64 before bit-shifting to
    prevent overflow when assigning to min_page_size.
    
    Cc: Matthew Auld <matthew.auld@xxxxxxxxx>
    Cc: Matthew Brost <matthew.brost@xxxxxxxxx>
    Signed-off-by: Nirmoy Das <nirmoy.das@xxxxxxxxx>
    Reviewed-by: Matthew Auld <matthew.auld@xxxxxxxxx>
    Signed-off-by: Matthew Auld <matthew.auld@xxxxxxxxx>
    Link: https://patchwork.freedesktop.org/patch/msgid/20240318164342.3094-1-nirmoy.das@xxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c b/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c
index 115ec745e5029..0678faf832126 100644
--- a/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c
+++ b/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c
@@ -91,7 +91,7 @@ static int xe_ttm_vram_mgr_new(struct ttm_resource_manager *man,
 
 	min_page_size = mgr->default_page_size;
 	if (tbo->page_alignment)
-		min_page_size = tbo->page_alignment << PAGE_SHIFT;
+		min_page_size = (u64)tbo->page_alignment << PAGE_SHIFT;
 
 	if (WARN_ON(min_page_size < mm->chunk_size)) {
 		err = -EINVAL;




[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