Skip to content

Commit 685f27c

Browse files
committed
Merge tag 'drm-misc-next-fixes-2025-12-10' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-next
drm-misc-next-fixes for v6.19-rc1: - Fix uaf in panthor. - Revert 8 byte alignment constraint for pitch in dumb bo's. - Fix DRM_MODE_FLAG_N.SYNC and !DRM_MODE_FLAG_P.SYNC handling renasas. Signed-off-by: Dave Airlie <airlied@redhat.com> From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Link: https://patch.msgid.link/a82c2a2a-314f-403b-85bf-9b3ee09b903c@linux.intel.com
2 parents c7685d1 + 308eeb8 commit 685f27c

4 files changed

Lines changed: 19 additions & 8 deletions

File tree

drivers/gpu/drm/drm_gem_dma_helper.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ int drm_gem_dma_dumb_create(struct drm_file *file_priv,
308308
struct drm_gem_dma_object *dma_obj;
309309
int ret;
310310

311-
ret = drm_mode_size_dumb(drm, args, SZ_8, 0);
311+
ret = drm_mode_size_dumb(drm, args, 0, 0);
312312
if (ret)
313313
return ret;
314314

drivers/gpu/drm/drm_gem_shmem_helper.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ int drm_gem_shmem_dumb_create(struct drm_file *file, struct drm_device *dev,
559559
{
560560
int ret;
561561

562-
ret = drm_mode_size_dumb(dev, args, SZ_8, 0);
562+
ret = drm_mode_size_dumb(dev, args, 0, 0);
563563
if (ret)
564564
return ret;
565565

drivers/gpu/drm/panthor/panthor_sched.c

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -779,6 +779,12 @@ struct panthor_job_profiling_data {
779779
*/
780780
#define MAX_GROUPS_PER_POOL 128
781781

782+
/*
783+
* Mark added on an entry of group pool Xarray to identify if the group has
784+
* been fully initialized and can be accessed elsewhere in the driver code.
785+
*/
786+
#define GROUP_REGISTERED XA_MARK_1
787+
782788
/**
783789
* struct panthor_group_pool - Group pool
784790
*
@@ -3007,7 +3013,7 @@ void panthor_fdinfo_gather_group_samples(struct panthor_file *pfile)
30073013
return;
30083014

30093015
xa_lock(&gpool->xa);
3010-
xa_for_each(&gpool->xa, i, group) {
3016+
xa_for_each_marked(&gpool->xa, i, group, GROUP_REGISTERED) {
30113017
guard(spinlock)(&group->fdinfo.lock);
30123018
pfile->stats.cycles += group->fdinfo.data.cycles;
30133019
pfile->stats.time += group->fdinfo.data.time;
@@ -3727,6 +3733,8 @@ int panthor_group_create(struct panthor_file *pfile,
37273733

37283734
group_init_task_info(group);
37293735

3736+
xa_set_mark(&gpool->xa, gid, GROUP_REGISTERED);
3737+
37303738
return gid;
37313739

37323740
err_erase_gid:
@@ -3744,6 +3752,9 @@ int panthor_group_destroy(struct panthor_file *pfile, u32 group_handle)
37443752
struct panthor_scheduler *sched = ptdev->scheduler;
37453753
struct panthor_group *group;
37463754

3755+
if (!xa_get_mark(&gpool->xa, group_handle, GROUP_REGISTERED))
3756+
return -EINVAL;
3757+
37473758
group = xa_erase(&gpool->xa, group_handle);
37483759
if (!group)
37493760
return -EINVAL;
@@ -3769,12 +3780,12 @@ int panthor_group_destroy(struct panthor_file *pfile, u32 group_handle)
37693780
}
37703781

37713782
static struct panthor_group *group_from_handle(struct panthor_group_pool *pool,
3772-
u32 group_handle)
3783+
unsigned long group_handle)
37733784
{
37743785
struct panthor_group *group;
37753786

37763787
xa_lock(&pool->xa);
3777-
group = group_get(xa_load(&pool->xa, group_handle));
3788+
group = group_get(xa_find(&pool->xa, &group_handle, group_handle, GROUP_REGISTERED));
37783789
xa_unlock(&pool->xa);
37793790

37803791
return group;
@@ -3861,7 +3872,7 @@ panthor_fdinfo_gather_group_mem_info(struct panthor_file *pfile,
38613872
return;
38623873

38633874
xa_lock(&gpool->xa);
3864-
xa_for_each(&gpool->xa, i, group) {
3875+
xa_for_each_marked(&gpool->xa, i, group, GROUP_REGISTERED) {
38653876
stats->resident += group->fdinfo.kbo_sizes;
38663877
if (group->csg_id >= 0)
38673878
stats->active += group->fdinfo.kbo_sizes;

drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,9 +492,9 @@ static void rcar_mipi_dsi_set_display_timing(struct rcar_mipi_dsi *dsi,
492492

493493
/* Configuration for Video Parameters, input is always RGB888 */
494494
vprmset0r = TXVMVPRMSET0R_BPP_24;
495-
if (mode->flags & DRM_MODE_FLAG_NVSYNC)
495+
if (!(mode->flags & DRM_MODE_FLAG_PVSYNC))
496496
vprmset0r |= TXVMVPRMSET0R_VSPOL_LOW;
497-
if (mode->flags & DRM_MODE_FLAG_NHSYNC)
497+
if (!(mode->flags & DRM_MODE_FLAG_PHSYNC))
498498
vprmset0r |= TXVMVPRMSET0R_HSPOL_LOW;
499499

500500
vprmset1r = TXVMVPRMSET1R_VACTIVE(mode->vdisplay)

0 commit comments

Comments
 (0)