public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [syzbot] [media?] general protection fault in vidtv_psi_desc_assign
@ 2025-12-30  8:41 syzbot
  2026-01-01 10:44 ` syzbot
  2026-03-03 11:27 ` [PATCH] media: vidtv: fix NULL pointer dereference in vidtv_channel_pmt_match_sections Ruslan Valiyev
  0 siblings, 2 replies; 3+ messages in thread
From: syzbot @ 2025-12-30  8:41 UTC (permalink / raw)
  To: dwlsalmeida, linux-kernel, linux-media, mchehab, syzkaller-bugs

Hello,

syzbot found the following issue on:

HEAD commit:    c875a6c32467 Merge tag 'usb-6.19-rc3' of git://git.kernel...
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=10e63bb4580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=8bfa57a8c0ab3aa8
dashboard link: https://syzkaller.appspot.com/bug?extid=1f5bcc7c919ec578777a
compiler:       gcc (Debian 12.2.0-14+deb12u1) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/8899a01b839d/disk-c875a6c3.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/24b995d869e5/vmlinux-c875a6c3.xz
kernel image: https://storage.googleapis.com/syzbot-assets/a87050fc4ee8/bzImage-c875a6c3.xz

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

RBP: 00007fbc65813f91 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fbc659e6038 R14: 00007fbc659e5fa0 R15: 00007ffcd46bbaa8
 </TASK>
Oops: general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] SMP KASAN PTI
KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
CPU: 0 UID: 0 PID: 17992 Comm: syz.1.2581 Tainted: G             L      syzkaller #0 PREEMPT(full) 
Tainted: [L]=SOFTLOCKUP
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025
RIP: 0010:vidtv_psi_desc_assign+0x24/0x90 drivers/media/test-drivers/vidtv/vidtv_psi.c:629
Code: 90 90 90 90 90 90 0f 1f 40 d6 41 54 55 48 89 f5 53 48 89 fb e8 dd 65 b9 f9 48 89 da 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 <80> 3c 02 00 75 47 4c 8b 23 49 39 ec 74 36 e8 b9 65 b9 f9 4d 85 e4
RSP: 0018:ffffc9000c61fa20 EFLAGS: 00010247
RAX: dffffc0000000000 RBX: 0000000000000005 RCX: ffffc9000daab000
RDX: 0000000000000000 RSI: ffffffff8804f313 RDI: 0000000000000005
RBP: ffff88807da44660 R08: 0000000000000000 R09: 4453534204050000
R10: 0000000000000005 R11: ffff88802cc229b0 R12: 0000000000000000
R13: ffff88807b485640 R14: ffff88801feace80 R15: ffff8880338e7800
FS:  00007fbc665bb6c0(0000) GS:ffff8881248fc000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000200001000000 CR3: 00000000767b2000 CR4: 00000000003526f0
Call Trace:
 <TASK>
 vidtv_channel_pmt_match_sections drivers/media/test-drivers/vidtv/vidtv_channel.c:349 [inline]
 vidtv_channel_si_init+0x1445/0x1a50 drivers/media/test-drivers/vidtv/vidtv_channel.c:479
 vidtv_mux_init+0x526/0xbe0 drivers/media/test-drivers/vidtv/vidtv_mux.c:519
 vidtv_start_streaming drivers/media/test-drivers/vidtv/vidtv_bridge.c:194 [inline]
 vidtv_start_feed+0x33e/0x4d0 drivers/media/test-drivers/vidtv/vidtv_bridge.c:239
 dmx_ts_feed_start_filtering+0xf6/0x220 drivers/media/dvb-core/dvb_demux.c:747
 dvb_dmxdev_start_feed+0x273/0x3f0 drivers/media/dvb-core/dmxdev.c:655
 dvb_dmxdev_filter_start+0x1b6/0xe10 drivers/media/dvb-core/dmxdev.c:766
 dvb_dmxdev_pes_filter_set drivers/media/dvb-core/dmxdev.c:963 [inline]
 dvb_demux_do_ioctl+0x9de/0x12f0 drivers/media/dvb-core/dmxdev.c:1077
 dvb_usercopy+0x167/0x340 drivers/media/dvb-core/dvbdev.c:999
 dvb_demux_ioctl+0x29/0x40 drivers/media/dvb-core/dmxdev.c:1186
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:597 [inline]
 __se_sys_ioctl fs/ioctl.c:583 [inline]
 __x64_sys_ioctl+0x18e/0x210 fs/ioctl.c:583
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xcd/0xf80 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fbc6578f7c9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fbc665bb038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fbc659e5fa0 RCX: 00007fbc6578f7c9
RDX: 0000000000000000 RSI: 0000000040146f2c RDI: 0000000000000003
RBP: 00007fbc65813f91 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fbc659e6038 R14: 00007fbc659e5fa0 R15: 00007ffcd46bbaa8
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:vidtv_psi_desc_assign+0x24/0x90 drivers/media/test-drivers/vidtv/vidtv_psi.c:629
Code: 90 90 90 90 90 90 0f 1f 40 d6 41 54 55 48 89 f5 53 48 89 fb e8 dd 65 b9 f9 48 89 da 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 <80> 3c 02 00 75 47 4c 8b 23 49 39 ec 74 36 e8 b9 65 b9 f9 4d 85 e4
RSP: 0018:ffffc9000c61fa20 EFLAGS: 00010247
RAX: dffffc0000000000 RBX: 0000000000000005 RCX: ffffc9000daab000
RDX: 0000000000000000 RSI: ffffffff8804f313 RDI: 0000000000000005
RBP: ffff88807da44660 R08: 0000000000000000 R09: 4453534204050000
R10: 0000000000000005 R11: ffff88802cc229b0 R12: 0000000000000000
R13: ffff88807b485640 R14: ffff88801feace80 R15: ffff8880338e7800
FS:  00007fbc665bb6c0(0000) GS:ffff8881248fc000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000557f4c7cc950 CR3: 00000000767b2000 CR4: 00000000003526f0
----------------
Code disassembly (best guess):
   0:	90                   	nop
   1:	90                   	nop
   2:	90                   	nop
   3:	90                   	nop
   4:	90                   	nop
   5:	90                   	nop
   6:	0f 1f 40 d6          	nopl   -0x2a(%rax)
   a:	41 54                	push   %r12
   c:	55                   	push   %rbp
   d:	48 89 f5             	mov    %rsi,%rbp
  10:	53                   	push   %rbx
  11:	48 89 fb             	mov    %rdi,%rbx
  14:	e8 dd 65 b9 f9       	call   0xf9b965f6
  19:	48 89 da             	mov    %rbx,%rdx
  1c:	48 b8 00 00 00 00 00 	movabs $0xdffffc0000000000,%rax
  23:	fc ff df
  26:	48 c1 ea 03          	shr    $0x3,%rdx
* 2a:	80 3c 02 00          	cmpb   $0x0,(%rdx,%rax,1) <-- trapping instruction
  2e:	75 47                	jne    0x77
  30:	4c 8b 23             	mov    (%rbx),%r12
  33:	49 39 ec             	cmp    %rbp,%r12
  36:	74 36                	je     0x6e
  38:	e8 b9 65 b9 f9       	call   0xf9b965f6
  3d:	4d 85 e4             	test   %r12,%r12


---
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 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

* Re: [syzbot] [media?] general protection fault in vidtv_psi_desc_assign
  2025-12-30  8:41 [syzbot] [media?] general protection fault in vidtv_psi_desc_assign syzbot
@ 2026-01-01 10:44 ` syzbot
  2026-03-03 11:27 ` [PATCH] media: vidtv: fix NULL pointer dereference in vidtv_channel_pmt_match_sections Ruslan Valiyev
  1 sibling, 0 replies; 3+ messages in thread
From: syzbot @ 2026-01-01 10:44 UTC (permalink / raw)
  To: dwlsalmeida, linux-kernel, linux-media, mchehab, syzkaller-bugs

syzbot has found a reproducer for the following issue on:

HEAD commit:    349bd28a86f2 Merge tag 'vfio-v6.19-rc4' of https://github...
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=17c43792580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=8bfa57a8c0ab3aa8
dashboard link: https://syzkaller.appspot.com/bug?extid=1f5bcc7c919ec578777a
compiler:       gcc (Debian 12.2.0-14+deb12u1) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=178b529a580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/1caf38a16cbb/disk-349bd28a.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/1650b6e78aae/vmlinux-349bd28a.xz
kernel image: https://storage.googleapis.com/syzbot-assets/df6e3c8e97c1/bzImage-349bd28a.xz

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

RSP: 002b:00007fc9113fe038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fc911fe5fa0 RCX: 00007fc911d8f7c9
RDX: 0000000000000000 RSI: 0000000040146f2c RDI: 0000000000000003
RBP: 00007fc911e13f91 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fc911fe6038 R14: 00007fc911fe5fa0 R15: 00007ffe9d4f0e68
 </TASK>
Oops: general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] SMP KASAN PTI
KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
CPU: 1 UID: 0 PID: 6109 Comm: syz.3.21 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025
RIP: 0010:vidtv_psi_desc_assign+0x24/0x90 drivers/media/test-drivers/vidtv/vidtv_psi.c:629
Code: 90 90 90 90 90 90 0f 1f 40 d6 41 54 55 48 89 f5 53 48 89 fb e8 cd 6d b9 f9 48 89 da 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 <80> 3c 02 00 75 47 4c 8b 23 49 39 ec 74 36 e8 a9 6d b9 f9 4d 85 e4
RSP: 0018:ffffc90003577a20 EFLAGS: 00010247
RAX: dffffc0000000000 RBX: 0000000000000005 RCX: 0000000000000001
RDX: 0000000000000000 RSI: ffffffff8804fd23 RDI: 0000000000000005
RBP: ffff88802879dd80 R08: 0000000000000000 R09: 4453534204050000
R10: 0000000000000005 R11: ffff88803393a9b0 R12: 0000000000000000
R13: ffff88807d440780 R14: ffff888020aab3e0 R15: ffff88807d440b00
FS:  00007fc9113fe6c0(0000) GS:ffff8881249fc000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 0000000075520000 CR4: 00000000003526f0
Call Trace:
 <TASK>
 vidtv_channel_pmt_match_sections drivers/media/test-drivers/vidtv/vidtv_channel.c:349 [inline]
 vidtv_channel_si_init+0x1445/0x1a50 drivers/media/test-drivers/vidtv/vidtv_channel.c:479
 vidtv_mux_init+0x526/0xbe0 drivers/media/test-drivers/vidtv/vidtv_mux.c:519
 vidtv_start_streaming drivers/media/test-drivers/vidtv/vidtv_bridge.c:194 [inline]
 vidtv_start_feed+0x33e/0x4d0 drivers/media/test-drivers/vidtv/vidtv_bridge.c:239
 dmx_ts_feed_start_filtering+0xf6/0x220 drivers/media/dvb-core/dvb_demux.c:747
 dvb_dmxdev_start_feed+0x273/0x3f0 drivers/media/dvb-core/dmxdev.c:655
 dvb_dmxdev_filter_start+0x1b6/0xe10 drivers/media/dvb-core/dmxdev.c:766
 dvb_dmxdev_pes_filter_set drivers/media/dvb-core/dmxdev.c:963 [inline]
 dvb_demux_do_ioctl+0x9de/0x12f0 drivers/media/dvb-core/dmxdev.c:1077
 dvb_usercopy+0x167/0x340 drivers/media/dvb-core/dvbdev.c:999
 dvb_demux_ioctl+0x29/0x40 drivers/media/dvb-core/dmxdev.c:1186
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:597 [inline]
 __se_sys_ioctl fs/ioctl.c:583 [inline]
 __x64_sys_ioctl+0x18e/0x210 fs/ioctl.c:583
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xcd/0xf80 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fc911d8f7c9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fc9113fe038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fc911fe5fa0 RCX: 00007fc911d8f7c9
RDX: 0000000000000000 RSI: 0000000040146f2c RDI: 0000000000000003
RBP: 00007fc911e13f91 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fc911fe6038 R14: 00007fc911fe5fa0 R15: 00007ffe9d4f0e68
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:vidtv_psi_desc_assign+0x24/0x90 drivers/media/test-drivers/vidtv/vidtv_psi.c:629
Code: 90 90 90 90 90 90 0f 1f 40 d6 41 54 55 48 89 f5 53 48 89 fb e8 cd 6d b9 f9 48 89 da 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 <80> 3c 02 00 75 47 4c 8b 23 49 39 ec 74 36 e8 a9 6d b9 f9 4d 85 e4
RSP: 0018:ffffc90003577a20 EFLAGS: 00010247
RAX: dffffc0000000000 RBX: 0000000000000005 RCX: 0000000000000001
RDX: 0000000000000000 RSI: ffffffff8804fd23 RDI: 0000000000000005
RBP: ffff88802879dd80 R08: 0000000000000000 R09: 4453534204050000
R10: 0000000000000005 R11: ffff88803393a9b0 R12: 0000000000000000
R13: ffff88807d440780 R14: ffff888020aab3e0 R15: ffff88807d440b00
FS:  00007fc9113fe6c0(0000) GS:ffff8881249fc000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 0000000075520000 CR4: 00000000003526f0
----------------
Code disassembly (best guess):
   0:	90                   	nop
   1:	90                   	nop
   2:	90                   	nop
   3:	90                   	nop
   4:	90                   	nop
   5:	90                   	nop
   6:	0f 1f 40 d6          	nopl   -0x2a(%rax)
   a:	41 54                	push   %r12
   c:	55                   	push   %rbp
   d:	48 89 f5             	mov    %rsi,%rbp
  10:	53                   	push   %rbx
  11:	48 89 fb             	mov    %rdi,%rbx
  14:	e8 cd 6d b9 f9       	call   0xf9b96de6
  19:	48 89 da             	mov    %rbx,%rdx
  1c:	48 b8 00 00 00 00 00 	movabs $0xdffffc0000000000,%rax
  23:	fc ff df
  26:	48 c1 ea 03          	shr    $0x3,%rdx
* 2a:	80 3c 02 00          	cmpb   $0x0,(%rdx,%rax,1) <-- trapping instruction
  2e:	75 47                	jne    0x77
  30:	4c 8b 23             	mov    (%rbx),%r12
  33:	49 39 ec             	cmp    %rbp,%r12
  36:	74 36                	je     0x6e
  38:	e8 a9 6d b9 f9       	call   0xf9b96de6
  3d:	4d 85 e4             	test   %r12,%r12


---
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.

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

* [PATCH] media: vidtv: fix NULL pointer dereference in vidtv_channel_pmt_match_sections
  2025-12-30  8:41 [syzbot] [media?] general protection fault in vidtv_psi_desc_assign syzbot
  2026-01-01 10:44 ` syzbot
@ 2026-03-03 11:27 ` Ruslan Valiyev
  1 sibling, 0 replies; 3+ messages in thread
From: Ruslan Valiyev @ 2026-03-03 11:27 UTC (permalink / raw)
  To: syzbot+1f5bcc7c919ec578777a, Daniel W . S . Almeida,
	Mauro Carvalho Chehab
  Cc: linux-media, linux-kernel, stable, syzkaller-bugs, Ruslan Valiyev

syzbot reported a general protection fault in vidtv_psi_desc_assign [1].

vidtv_psi_pmt_stream_init() can return NULL on memory allocation
failure, but vidtv_channel_pmt_match_sections() does not check for
this. When tail is NULL, the subsequent call to
vidtv_psi_desc_assign(&tail->descriptor, desc) dereferences a NULL
pointer offset, causing a general protection fault.

Add a NULL check after vidtv_psi_pmt_stream_init(). On failure, clean
up the already-allocated stream chain and return.

[1]
Oops: general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] SMP KASAN PTI
KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
RIP: 0010:vidtv_psi_desc_assign+0x24/0x90 drivers/media/test-drivers/vidtv/vidtv_psi.c:629
Call Trace:
 <TASK>
 vidtv_channel_pmt_match_sections drivers/media/test-drivers/vidtv/vidtv_channel.c:349 [inline]
 vidtv_channel_si_init+0x1445/0x1a50 drivers/media/test-drivers/vidtv/vidtv_channel.c:479
 vidtv_mux_init+0x526/0xbe0 drivers/media/test-drivers/vidtv/vidtv_mux.c:519
 vidtv_start_streaming drivers/media/test-drivers/vidtv/vidtv_bridge.c:194 [inline]
 vidtv_start_feed+0x33e/0x4d0 drivers/media/test-drivers/vidtv/vidtv_bridge.c:239

Fixes: f90cf6079bf67 ("media: vidtv: add a bridge driver")
Cc: stable@vger.kernel.org
Reported-by: syzbot+1f5bcc7c919ec578777a@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=1f5bcc7c919ec578777a
Signed-off-by: Ruslan Valiyev <linuxoid@gmail.com>
---
 drivers/media/test-drivers/vidtv/vidtv_channel.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/media/test-drivers/vidtv/vidtv_channel.c b/drivers/media/test-drivers/vidtv/vidtv_channel.c
index da20657adc747..5f8c3af871711 100644
--- a/drivers/media/test-drivers/vidtv/vidtv_channel.c
+++ b/drivers/media/test-drivers/vidtv/vidtv_channel.c
@@ -341,6 +341,10 @@ vidtv_channel_pmt_match_sections(struct vidtv_channel *channels,
 					tail = vidtv_psi_pmt_stream_init(tail,
 									 s->type,
 									 e_pid);
+					if (!tail) {
+						vidtv_psi_pmt_stream_destroy(head);
+						return;
+					}
 
 					if (!head)
 						head = tail;
-- 
2.43.0


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

end of thread, other threads:[~2026-03-03 11:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-30  8:41 [syzbot] [media?] general protection fault in vidtv_psi_desc_assign syzbot
2026-01-01 10:44 ` syzbot
2026-03-03 11:27 ` [PATCH] media: vidtv: fix NULL pointer dereference in vidtv_channel_pmt_match_sections Ruslan Valiyev

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