]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/panthor: validate group queue count
authorChia-I Wu <olvaffe@gmail.com>
Wed, 3 Sep 2025 19:21:33 +0000 (12:21 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 19 Sep 2025 14:35:48 +0000 (16:35 +0200)
[ Upstream commit a00f2015acdbd8a4b3d2382eaeebe11db1925fad ]

A panthor group can have at most MAX_CS_PER_CSG panthor queues.

Fixes: 4bdca11507928 ("drm/panthor: Add the driver frontend block")
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> # v1
Reviewed-by: Steven Price <steven.price@arm.com>
Signed-off-by: Steven Price <steven.price@arm.com>
Link: https://lore.kernel.org/r/20250903192133.288477-1-olvaffe@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/panthor/panthor_drv.c

index c520f156e2d73f7e735f8bf2d6d8e8efacec9362..03eb7d52209a2fb20eab332e6401df20b8ac44d5 100644 (file)
@@ -1023,7 +1023,7 @@ static int panthor_ioctl_group_create(struct drm_device *ddev, void *data,
        struct drm_panthor_queue_create *queue_args;
        int ret;
 
-       if (!args->queues.count)
+       if (!args->queues.count || args->queues.count > MAX_CS_PER_CSG)
                return -EINVAL;
 
        ret = PANTHOR_UOBJ_GET_ARRAY(queue_args, &args->queues);