The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [syzbot] [dri?] WARNING in drm_property_add_enum
@ 2026-08-16  6:30 syzbot
  2026-08-16  8:23 ` Forwarded: [PATCH] drm/gud: NUL-terminate TV mode names read from the device syzbot
  0 siblings, 1 reply; 3+ messages in thread
From: syzbot @ 2026-08-16  6:30 UTC (permalink / raw)
  To: airlied, dri-devel, linux-kernel, maarten.lankhorst, mripard,
	rubenru09, simona, syzkaller-bugs, tzimmermann

Hello,

syzbot found the following issue on:

HEAD commit:    f5bbbfec59b4 Merge tag 'probes-fixes-v7.2-rc7' of git://gi..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=132db479580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=8a233ed2ce9a8096
dashboard link: https://syzkaller.appspot.com/bug?extid=916c888ba5f1a54c9526
compiler:       gcc (Debian 14.2.0-19) 14.2.0, GNU ld (GNU Binutils for Debian) 2.44
userspace arch: i386
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=105c4c79580000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=15a91149580000

Downloadable assets:
disk image (non-bootable): https://storage.googleapis.com/syzbot-assets/d900f083ada3/non_bootable_disk-f5bbbfec.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/48f3b996e46b/vmlinux-f5bbbfec.xz
kernel image: https://storage.googleapis.com/syzbot-assets/523783d7181e/bzImage-f5bbbfec.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+916c888ba5f1a54c9526@syzkaller.appspotmail.com

usb 5-1: config 1 interface 0 altsetting 0 has 1 endpoint descriptor, different from the interface descriptor's value: 2
usb 5-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
------------[ cut here ]------------
strlen(name) >= DRM_PROP_NAME_LEN
WARNING: drivers/gpu/drm/drm_property.c:396 at drm_property_add_enum+0x4ac/0x590 drivers/gpu/drm/drm_property.c:396, CPU#2: kworker/2:3/5894
Modules linked in:
CPU: 2 UID: 0 PID: 5894 Comm: kworker/2:3 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
Workqueue: usb_hub_wq hub_event
RIP: 0010:drm_property_add_enum+0x4ac/0x590 drivers/gpu/drm/drm_property.c:396
Code: 03 80 3c 02 00 0f 85 89 00 00 00 49 89 2c 24 31 db e9 fc fc ff ff e8 f3 e9 43 fc 90 0f 0b 90 e9 e9 fc ff ff e8 e5 e9 43 fc 90 <0f> 0b 90 e9 db fc ff ff e8 87 7e b3 fc e9 b3 fb ff ff e8 cd e9 43
RSP: 0000:ffffc90002fd6cf0 EFLAGS: 00010293
RAX: 0000000000000000 RBX: 0000000000000050 RCX: ffffffff85c5e14d
RDX: ffff888027ba0000 RSI: ffffffff85c5e5bb RDI: ffff888027ba0000
RBP: 0000000000000000 R08: 0000000000000007 R09: 000000000000001f
R10: 0000000000000050 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000005 R14: ffff88802a8e4100 R15: dffffc0000000000
FS:  0000000000000000(0000) GS:ffff888096df3000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055d682c98168 CR3: 000000004ce67000 CR4: 0000000000352ef0
Call Trace:
 <TASK>
 drm_mode_create_tv_properties_legacy+0x3e9/0x4c0 drivers/gpu/drm/drm_connector.c:2216
 gud_connector_add_tv_mode+0x1d7/0x2b0 drivers/gpu/drm/gud/gud_connector.c:402
 gud_connector_add_properties drivers/gpu/drm/gud/gud_connector.c:525 [inline]
 gud_connector_create drivers/gpu/drm/gud/gud_connector.c:680 [inline]
 gud_get_connectors+0xbd9/0x1700 drivers/gpu/drm/gud/gud_connector.c:717
 gud_probe+0x17aa/0x1c20 drivers/gpu/drm/gud/gud_drv.c:635
 usb_probe_interface+0x303/0x8f0 drivers/usb/core/driver.c:396
 call_driver_probe drivers/base/dd.c:628 [inline]
 really_probe+0x241/0xa60 drivers/base/dd.c:706
 __driver_probe_device+0x20e/0x450 drivers/base/dd.c:868
 driver_probe_device+0x4a/0x140 drivers/base/dd.c:898
 __device_attach_driver+0x1df/0x320 drivers/base/dd.c:1026
 bus_for_each_drv+0x159/0x1e0 drivers/base/bus.c:500
 __device_attach+0x1e4/0x4d0 drivers/base/dd.c:1098
 device_initial_probe+0xaf/0xd0 drivers/base/dd.c:1153
 bus_probe_device+0x64/0x160 drivers/base/bus.c:620
 device_add+0x121d/0x1970 drivers/base/core.c:3772
 usb_set_configuration+0xd97/0x1c60 drivers/usb/core/message.c:2268
 usb_generic_driver_probe+0xa1/0xe0 drivers/usb/core/generic.c:250
 usb_probe_device+0xef/0x400 drivers/usb/core/driver.c:291
 call_driver_probe drivers/base/dd.c:628 [inline]
 really_probe+0x241/0xa60 drivers/base/dd.c:706
 __driver_probe_device+0x20e/0x450 drivers/base/dd.c:868
 driver_probe_device+0x4a/0x140 drivers/base/dd.c:898
 __device_attach_driver+0x1df/0x320 drivers/base/dd.c:1026
 bus_for_each_drv+0x159/0x1e0 drivers/base/bus.c:500
 __device_attach+0x1e4/0x4d0 drivers/base/dd.c:1098
 device_initial_probe+0xaf/0xd0 drivers/base/dd.c:1153
 bus_probe_device+0x64/0x160 drivers/base/bus.c:620
 device_add+0x121d/0x1970 drivers/base/core.c:3772
 usb_new_device.part.0+0xcc2/0x1686 drivers/usb/core/hub.c:2703
 usb_new_device include/linux/workqueue.h:714 [inline]
 hub_port_connect drivers/usb/core/hub.c:5575 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5715 [inline]
 port_event drivers/usb/core/hub.c:5879 [inline]
 hub_event.cold+0x1e3/0xe90 drivers/usb/core/hub.c:5961
 process_one_work+0xa23/0x1940 kernel/workqueue.c:3322
 process_scheduled_works kernel/workqueue.c:3405 [inline]
 worker_thread+0x5ef/0xe50 kernel/workqueue.c:3486
 kthread+0x370/0x450 kernel/kthread.c:436
 ret_from_fork+0x72b/0xd50 arch/x86/kernel/process.c:158
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
 </TASK>


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Forwarded: [PATCH] drm/gud: NUL-terminate TV mode names read from the device
  2026-08-16  6:30 [syzbot] [dri?] WARNING in drm_property_add_enum syzbot
@ 2026-08-16  8:23 ` syzbot
  0 siblings, 0 replies; 3+ messages in thread
From: syzbot @ 2026-08-16  8:23 UTC (permalink / raw)
  To: linux-kernel, syzkaller-bugs

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.

***

Subject: [PATCH] drm/gud: NUL-terminate TV mode names read from the device
Author: kartikey406@gmail.com

#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master


gud_connector_add_tv_mode() reads a buffer of fixed-size mode names from
the USB device and passes pointers into it to
drm_mode_create_tv_properties_legacy(), which calls strlen() on each one.
Nothing guarantees the device NUL-terminates a name, so strlen() can run
past the end of a slot and, for the last mode, past the end of the
allocation.

Terminate each name at the end of its slot before use.

Reported-by: syzbot+916c888ba5f1a54c9526@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=916c888ba5f1a54c9526
Signed-off-by: Deepanshu Kartikey <kartikey406@gmail.com>
---
 drivers/gpu/drm/gud/gud_connector.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/gud/gud_connector.c b/drivers/gpu/drm/gud/gud_connector.c
index ea0cca58b7c8..5c0065c876a7 100644
--- a/drivers/gpu/drm/gud/gud_connector.c
+++ b/drivers/gpu/drm/gud/gud_connector.c
@@ -396,8 +396,13 @@ static int gud_connector_add_tv_mode(struct gud_device *gdrm, struct drm_connect
 	}
 
 	num_modes = ret / GUD_CONNECTOR_TV_MODE_NAME_LEN;
-	for (i = 0; i < num_modes; i++)
-		modes[i] = &buf[i * GUD_CONNECTOR_TV_MODE_NAME_LEN];
+	for (i = 0; i < num_modes; i++) {
+		char *mode = &buf[i * GUD_CONNECTOR_TV_MODE_NAME_LEN];
+
+		/* The device is not trusted to NUL-terminate the name */
+		mode[GUD_CONNECTOR_TV_MODE_NAME_LEN - 1] = '\0';
+		modes[i] = mode;
+	}
 
 	ret = drm_mode_create_tv_properties_legacy(connector->dev, num_modes, modes);
 free:
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [syzbot] [dri?] WARNING in drm_property_add_enum
       [not found] <20260816082315.20861-1-kartikey406@gmail.com>
@ 2026-08-16  8:44 ` syzbot
  0 siblings, 0 replies; 3+ messages in thread
From: syzbot @ 2026-08-16  8:44 UTC (permalink / raw)
  To: kartikey406, linux-kernel, syzkaller-bugs

Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-by: syzbot+916c888ba5f1a54c9526@syzkaller.appspotmail.com
Tested-by: syzbot+916c888ba5f1a54c9526@syzkaller.appspotmail.com

Tested on:

commit:         3eb40771 Merge tag 'soc-fixes-7.2-3' of git://git.kern..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=12261949580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=8a233ed2ce9a8096
dashboard link: https://syzkaller.appspot.com/bug?extid=916c888ba5f1a54c9526
compiler:       gcc (Debian 14.2.0-19) 14.2.0, GNU ld (GNU Binutils for Debian) 2.44
userspace arch: i386
patch:          https://syzkaller.appspot.com/x/patch.diff?x=1047c6c6580000

Note: testing is done by a robot and is best-effort only.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-08-16  8:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-16  6:30 [syzbot] [dri?] WARNING in drm_property_add_enum syzbot
2026-08-16  8:23 ` Forwarded: [PATCH] drm/gud: NUL-terminate TV mode names read from the device syzbot
     [not found] <20260816082315.20861-1-kartikey406@gmail.com>
2026-08-16  8:44 ` [syzbot] [dri?] WARNING in drm_property_add_enum syzbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox