Skip to content

Commit cab2932

Browse files
committed
Merge tag 'drm-misc-fixes-2023-04-13' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes
Short summary of fixes pull: * armada: Fix double free * fb: Clear FB_ACTIVATE_KD_TEXT in ioctl * nouveau: Add missing callbacks * scheduler: Fix use-after-free error Signed-off-by: Daniel Vetter <[email protected]> From: Thomas Zimmermann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/20230413184233.GA8148@linux-uq9g
2 parents fffb0b5 + 5603eff commit cab2932

File tree

7 files changed

+15
-3
lines changed

7 files changed

+15
-3
lines changed

drivers/gpu/drm/armada/armada_drv.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ static int armada_drm_bind(struct device *dev)
9999
if (ret) {
100100
dev_err(dev, "[" DRM_NAME ":%s] can't kick out simple-fb: %d\n",
101101
__func__, ret);
102-
kfree(priv);
103102
return ret;
104103
}
105104

drivers/gpu/drm/nouveau/nvkm/subdev/fb/gf108.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ gf108_fb = {
3131
.init = gf100_fb_init,
3232
.init_page = gf100_fb_init_page,
3333
.intr = gf100_fb_intr,
34+
.sysmem.flush_page_init = gf100_fb_sysmem_flush_page_init,
3435
.ram_new = gf108_ram_new,
3536
.default_bigpage = 17,
3637
};

drivers/gpu/drm/nouveau/nvkm/subdev/fb/gk104.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ gk104_fb = {
7777
.init = gf100_fb_init,
7878
.init_page = gf100_fb_init_page,
7979
.intr = gf100_fb_intr,
80+
.sysmem.flush_page_init = gf100_fb_sysmem_flush_page_init,
8081
.ram_new = gk104_ram_new,
8182
.default_bigpage = 17,
8283
.clkgate_pack = gk104_fb_clkgate_pack,

drivers/gpu/drm/nouveau/nvkm/subdev/fb/gk110.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ gk110_fb = {
5959
.init = gf100_fb_init,
6060
.init_page = gf100_fb_init_page,
6161
.intr = gf100_fb_intr,
62+
.sysmem.flush_page_init = gf100_fb_sysmem_flush_page_init,
6263
.ram_new = gk104_ram_new,
6364
.default_bigpage = 17,
6465
.clkgate_pack = gk110_fb_clkgate_pack,

drivers/gpu/drm/nouveau/nvkm/subdev/fb/gm107.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ gm107_fb = {
3131
.init = gf100_fb_init,
3232
.init_page = gf100_fb_init_page,
3333
.intr = gf100_fb_intr,
34+
.sysmem.flush_page_init = gf100_fb_sysmem_flush_page_init,
3435
.ram_new = gm107_ram_new,
3536
.default_bigpage = 17,
3637
};

drivers/gpu/drm/scheduler/sched_entity.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,12 +507,19 @@ void drm_sched_entity_push_job(struct drm_sched_job *sched_job)
507507
{
508508
struct drm_sched_entity *entity = sched_job->entity;
509509
bool first;
510+
ktime_t submit_ts;
510511

511512
trace_drm_sched_job(sched_job, entity);
512513
atomic_inc(entity->rq->sched->score);
513514
WRITE_ONCE(entity->last_user, current->group_leader);
515+
516+
/*
517+
* After the sched_job is pushed into the entity queue, it may be
518+
* completed and freed up at any time. We can no longer access it.
519+
* Make sure to set the submit_ts first, to avoid a race.
520+
*/
521+
sched_job->submit_ts = submit_ts = ktime_get();
514522
first = spsc_queue_push(&entity->job_queue, &sched_job->queue_node);
515-
sched_job->submit_ts = ktime_get();
516523

517524
/* first job wakes up scheduler */
518525
if (first) {
@@ -529,7 +536,7 @@ void drm_sched_entity_push_job(struct drm_sched_job *sched_job)
529536
spin_unlock(&entity->rq_lock);
530537

531538
if (drm_sched_policy == DRM_SCHED_POLICY_FIFO)
532-
drm_sched_rq_update_fifo(entity, sched_job->submit_ts);
539+
drm_sched_rq_update_fifo(entity, submit_ts);
533540

534541
drm_sched_wakeup(entity->rq->sched);
535542
}

drivers/video/fbdev/core/fbmem.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,6 +1116,8 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd,
11161116
case FBIOPUT_VSCREENINFO:
11171117
if (copy_from_user(&var, argp, sizeof(var)))
11181118
return -EFAULT;
1119+
/* only for kernel-internal use */
1120+
var.activate &= ~FB_ACTIVATE_KD_TEXT;
11191121
console_lock();
11201122
lock_fb_info(info);
11211123
ret = fbcon_modechange_possible(info, &var);

0 commit comments

Comments
 (0)