All of lore.kernel.org
 help / color / mirror / Atom feed
* [syzbot] KASAN: null-ptr-deref Write in snd_pcm_format_set_silence
@ 2022-04-08 22:52 syzbot
  2022-04-09  0:41 ` Fabio M. De Francesco
  0 siblings, 1 reply; 3+ messages in thread
From: syzbot @ 2022-04-08 22:52 UTC (permalink / raw)
  To: alsa-devel, linux-kernel, perex, syzkaller-bugs, tiwai

Hello,

syzbot found the following issue on:

HEAD commit:    312310928417 Linux 5.18-rc1
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=16f30a90f00000
kernel config:  https://syzkaller.appspot.com/x/.config?x=595bcd2109a73f9c
dashboard link: https://syzkaller.appspot.com/bug?extid=205eb15961852c2c5974
compiler:       gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=1798df4f700000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=12981dbf700000

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

==================================================================
BUG: KASAN: null-ptr-deref in snd_pcm_format_set_silence sound/core/pcm_misc.c:441 [inline]
BUG: KASAN: null-ptr-deref in snd_pcm_format_set_silence+0x215/0x350 sound/core/pcm_misc.c:424
Write of size 16383 at addr 0000000000000001 by task syz-executor156/3605

CPU: 0 PID: 3605 Comm: syz-executor156 Not tainted 5.18.0-rc1-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
 print_report mm/kasan/report.c:432 [inline]
 kasan_report.cold+0x61/0x1c6 mm/kasan/report.c:491
 check_region_inline mm/kasan/generic.c:183 [inline]
 kasan_check_range+0x13d/0x180 mm/kasan/generic.c:189
 memset+0x20/0x40 mm/kasan/shadow.c:44
 snd_pcm_format_set_silence sound/core/pcm_misc.c:441 [inline]
 snd_pcm_format_set_silence+0x215/0x350 sound/core/pcm_misc.c:424
 snd_pcm_oss_sync+0x60e/0x800 sound/core/oss/pcm_oss.c:1690
 snd_pcm_oss_ioctl+0x208c/0x3430 sound/core/oss/pcm_oss.c:2634
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:870 [inline]
 __se_sys_ioctl fs/ioctl.c:856 [inline]
 __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:856
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0x80 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7f0846a59e69
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 c1 18 00 00 90 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f0846c74318 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f0846af0028 RCX: 00007f0846a59e69
RDX: 0000000000000000 RSI: 0000000000005001 RDI: 0000000000000003
RBP: 00007f0846af0020 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 6475612f7665642f
R13: 00007f0846bffd8f R14: 00007f0846c74400 R15: 0000000000022000
 </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.
syzbot can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches

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

* Re: [syzbot] KASAN: null-ptr-deref Write in snd_pcm_format_set_silence
  2022-04-08 22:52 [syzbot] KASAN: null-ptr-deref Write in snd_pcm_format_set_silence syzbot
@ 2022-04-09  0:41 ` Fabio M. De Francesco
  2022-04-09  0:51   ` syzbot
  0 siblings, 1 reply; 3+ messages in thread
From: Fabio M. De Francesco @ 2022-04-09  0:41 UTC (permalink / raw)
  To: alsa-devel, linux-kernel, perex, syzkaller-bugs, tiwai; +Cc: syzbot

[-- Attachment #1: Type: text/plain, Size: 4008 bytes --]

On sabato 9 aprile 2022 00:52:26 CEST syzbot wrote:
> Hello,
> 
> syzbot found the following issue on:
> 
> HEAD commit:    312310928417 Linux 5.18-rc1
> git tree:       upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=16f30a90f00000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=595bcd2109a73f9c
> dashboard link: https://syzkaller.appspot.com/bug?extid=205eb15961852c2c5974
> compiler:       gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=1798df4f700000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=12981dbf700000
> 
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+205eb15961852c2c5974@syzkaller.appspotmail.com
> 
> ==================================================================
> BUG: KASAN: null-ptr-deref in snd_pcm_format_set_silence sound/core/pcm_misc.c:441 [inline]
> BUG: KASAN: null-ptr-deref in snd_pcm_format_set_silence+0x215/0x350 sound/core/pcm_misc.c:424
> Write of size 16383 at addr 0000000000000001 by task syz-executor156/3605
> 
> CPU: 0 PID: 3605 Comm: syz-executor156 Not tainted 5.18.0-rc1-syzkaller #0
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
> Call Trace:
>  <TASK>
>  __dump_stack lib/dump_stack.c:88 [inline]
>  dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
>  print_report mm/kasan/report.c:432 [inline]
>  kasan_report.cold+0x61/0x1c6 mm/kasan/report.c:491
>  check_region_inline mm/kasan/generic.c:183 [inline]
>  kasan_check_range+0x13d/0x180 mm/kasan/generic.c:189
>  memset+0x20/0x40 mm/kasan/shadow.c:44
>  snd_pcm_format_set_silence sound/core/pcm_misc.c:441 [inline]
>  snd_pcm_format_set_silence+0x215/0x350 sound/core/pcm_misc.c:424
>  snd_pcm_oss_sync+0x60e/0x800 sound/core/oss/pcm_oss.c:1690
>  snd_pcm_oss_ioctl+0x208c/0x3430 sound/core/oss/pcm_oss.c:2634
>  vfs_ioctl fs/ioctl.c:51 [inline]
>  __do_sys_ioctl fs/ioctl.c:870 [inline]
>  __se_sys_ioctl fs/ioctl.c:856 [inline]
>  __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:856
>  do_syscall_x64 arch/x86/entry/common.c:50 [inline]
>  do_syscall_64+0x35/0x80 arch/x86/entry/common.c:80
>  entry_SYSCALL_64_after_hwframe+0x44/0xae
> RIP: 0033:0x7f0846a59e69
> Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 c1 18 00 00 90 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 b8 ff ff ff f7 d8 64 89 01 48
> RSP: 002b:00007f0846c74318 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
> RAX: ffffffffffffffda RBX: 00007f0846af0028 RCX: 00007f0846a59e69
> RDX: 0000000000000000 RSI: 0000000000005001 RDI: 0000000000000003
> RBP: 00007f0846af0020 R08: 0000000000000000 R09: 0000000000000000
> R10: 0000000000000000 R11: 0000000000000246 R12: 6475612f7665642f
> R13: 00007f0846bffd8f R14: 00007f0846c74400 R15: 0000000000022000
>  </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.
> syzbot can test patches for this issue, for details see:
> https://goo.gl/tpsmEJ#testing-patches
> 
> -- 
> You received this message because you are subscribed to the Google Groups "syzkaller-bugs" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to syzkaller-bugs+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/syzkaller-bugs/000000000000d188ef05dc2c7279%40google.com.
> 
Let's try and check if "pat" is valid...

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

Fabio M. De Francesco

P.S.: I'm sorry, in my previous email I forgot to Cc all people and lists.

[-- Attachment #2: snd_pcm_format_set_silence.diff --]
[-- Type: text/x-patch, Size: 518 bytes --]

diff --git a/sound/core/pcm_misc.c b/sound/core/pcm_misc.c
index 4866aed97aac..5588b6a1ee8b 100644
--- a/sound/core/pcm_misc.c
+++ b/sound/core/pcm_misc.c
@@ -433,7 +433,7 @@ int snd_pcm_format_set_silence(snd_pcm_format_t format, void *data, unsigned int
 		return 0;
 	width = pcm_formats[(INT)format].phys; /* physical width */
 	pat = pcm_formats[(INT)format].silence;
-	if (! width)
+	if (!width || !pat)
 		return -EINVAL;
 	/* signed or 1 byte data */
 	if (pcm_formats[(INT)format].signd == 1 || width <= 8) {

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

* Re: [syzbot] KASAN: null-ptr-deref Write in snd_pcm_format_set_silence
  2022-04-09  0:41 ` Fabio M. De Francesco
@ 2022-04-09  0:51   ` syzbot
  0 siblings, 0 replies; 3+ messages in thread
From: syzbot @ 2022-04-09  0:51 UTC (permalink / raw)
  To: alsa-devel, fmdefrancesco, linux-kernel, perex, syzkaller-bugs, tiwai

Hello,

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

Reported-and-tested-by: syzbot+205eb15961852c2c5974@syzkaller.appspotmail.com

Tested on:

commit:         1a3b1bba Merge tag 'nfs-for-5.18-2' of git://git.linux..
git tree:       upstream
kernel config:  https://syzkaller.appspot.com/x/.config?x=df0c3f2244c64190
dashboard link: https://syzkaller.appspot.com/bug?extid=205eb15961852c2c5974
compiler:       gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2
patch:          https://syzkaller.appspot.com/x/patch.diff?x=17fb5d30f00000

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:[~2022-04-09  0:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-08 22:52 [syzbot] KASAN: null-ptr-deref Write in snd_pcm_format_set_silence syzbot
2022-04-09  0:41 ` Fabio M. De Francesco
2022-04-09  0:51   ` syzbot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.