Patch "drm_lease.c: copy user-array safely" 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_lease.c: copy user-array safely

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_lease.c-copy-user-array-safely.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 101ebb5808918b1219a91432a4aa9d9eabefdacb
Author: Philipp Stanner <pstanner@xxxxxxxxxx>
Date:   Wed Sep 20 14:36:12 2023 +0200

    drm_lease.c: copy user-array safely
    
    [ Upstream commit f37d63e219c39199a59b8b8a211412ff27192830 ]
    
    Currently, there is no overflow-check with memdup_user().
    
    Use the new function memdup_array_user() instead of memdup_user() for
    duplicating the user-space array safely.
    
    Suggested-by: David Airlie <airlied@xxxxxxxxxx>
    Signed-off-by: Philipp Stanner <pstanner@xxxxxxxxxx>
    Reviewed-by: Kees Cook <keescook@xxxxxxxxxxxx>
    Reviewed-by: Zack Rusin <zackr@xxxxxxxxxx>
    Signed-off-by: Dave Airlie <airlied@xxxxxxxxxx>
    Link: https://patchwork.freedesktop.org/patch/msgid/20230920123612.16914-6-pstanner@xxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c
index 150fe15550680..94375c6a54256 100644
--- a/drivers/gpu/drm/drm_lease.c
+++ b/drivers/gpu/drm/drm_lease.c
@@ -510,8 +510,8 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
 	/* Handle leased objects, if any */
 	idr_init(&leases);
 	if (object_count != 0) {
-		object_ids = memdup_user(u64_to_user_ptr(cl->object_ids),
-					 array_size(object_count, sizeof(__u32)));
+		object_ids = memdup_array_user(u64_to_user_ptr(cl->object_ids),
+					       object_count, sizeof(__u32));
 		if (IS_ERR(object_ids)) {
 			ret = PTR_ERR(object_ids);
 			idr_destroy(&leases);



[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