Skip to content

Commit 50f4b57

Browse files
Mads Bligaard Nielsengregkh
authored andcommitted
drm/bridge: adv7511: fix crash on irq during probe
[ Upstream commit aeedaee ] Moved IRQ registration down to end of adv7511_probe(). If an IRQ already is pending during adv7511_probe (before adv7511_cec_init) then cec_received_msg_ts could crash using uninitialized data: Unable to handle kernel read from unreadable memory at virtual address 00000000000003d5 Internal error: Oops: 96000004 [#1] PREEMPT_RT SMP Call trace: cec_received_msg_ts+0x48/0x990 [cec] adv7511_cec_irq_process+0x1cc/0x308 [adv7511] adv7511_irq_process+0xd8/0x120 [adv7511] adv7511_irq_handler+0x1c/0x30 [adv7511] irq_thread_fn+0x30/0xa0 irq_thread+0x14c/0x238 kthread+0x190/0x1a8 Fixes: 3b1b975 ("drm: adv7511/33: add HDMI CEC support") Signed-off-by: Mads Bligaard Nielsen <bli@bang-olufsen.dk> Signed-off-by: Alvin Šipraga <alsi@bang-olufsen.dk> Reviewed-by: Robert Foss <rfoss@kernel.org> Signed-off-by: Robert Foss <rfoss@kernel.org> Link: https://patchwork.freedesktop.org/patch/msgid/20240219-adv7511-cec-irq-crash-fix-v2-1-245e53c4b96f@bang-olufsen.dk (cherry picked from commit aeedaee) [Harshit: CVE-2024-26876; Resolve conflicts due to missing commit: c755512 ("drm: adv7511: Add has_dsi variable to struct adv7511_chip_info") in 6.6.y and adv7511_chip_info struct is also not defined] Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent fd4d5cd commit 50f4b57

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

drivers/gpu/drm/bridge/adv7511/adv7511_drv.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,17 +1291,6 @@ static int adv7511_probe(struct i2c_client *i2c)
12911291

12921292
INIT_WORK(&adv7511->hpd_work, adv7511_hpd_work);
12931293

1294-
if (i2c->irq) {
1295-
init_waitqueue_head(&adv7511->wq);
1296-
1297-
ret = devm_request_threaded_irq(dev, i2c->irq, NULL,
1298-
adv7511_irq_handler,
1299-
IRQF_ONESHOT, dev_name(dev),
1300-
adv7511);
1301-
if (ret)
1302-
goto err_unregister_cec;
1303-
}
1304-
13051294
adv7511_power_off(adv7511);
13061295

13071296
i2c_set_clientdata(i2c, adv7511);
@@ -1325,6 +1314,17 @@ static int adv7511_probe(struct i2c_client *i2c)
13251314

13261315
adv7511_audio_init(dev, adv7511);
13271316

1317+
if (i2c->irq) {
1318+
init_waitqueue_head(&adv7511->wq);
1319+
1320+
ret = devm_request_threaded_irq(dev, i2c->irq, NULL,
1321+
adv7511_irq_handler,
1322+
IRQF_ONESHOT, dev_name(dev),
1323+
adv7511);
1324+
if (ret)
1325+
goto err_unregister_audio;
1326+
}
1327+
13281328
if (adv7511->type == ADV7533 || adv7511->type == ADV7535) {
13291329
ret = adv7533_attach_dsi(adv7511);
13301330
if (ret)

0 commit comments

Comments
 (0)