From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FROM_LOCAL_HEX,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 77602C433DF for ; Fri, 31 Jul 2020 06:43:49 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0096D207F5 for ; Fri, 31 Jul 2020 06:43:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="plPqs16u" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0096D207F5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 82F7716AA; Fri, 31 Jul 2020 08:42:57 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 82F7716AA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1596177827; bh=1aExiYvoCR3vm1QizpcuMO9UyHIwhHWUbQxsmWXUNTs=; h=Date:Subject:From:To:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=plPqs16urr3IOnG1k0ePHgpoYn57Cuq1fT4LlUBDdsB0N2lCrifEP9bzcxpD+iYQD 8EKB9Axk+2jRnggB+3MlAz5H1byW6PYKJuUQjoaXXpw6ST3+zSksKXWBLoASpoR7QZ EDaZWaxw9SDHJ0dTAtgE5KfnWy8MABzRD7BgeSRg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 11E13F801ED; Fri, 31 Jul 2020 08:41:20 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A3A6AF8021E; Thu, 30 Jul 2020 07:53:30 +0200 (CEST) Received: from mail-il1-f197.google.com (mail-il1-f197.google.com [209.85.166.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 96600F8012F for ; Thu, 30 Jul 2020 07:53:22 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 96600F8012F Received: by mail-il1-f197.google.com with SMTP id e4so4497723ilr.0 for ; Wed, 29 Jul 2020 22:53:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:date:message-id:subject:from:to; bh=cZqveESVb4dxGAsDKYcIwEFOolAR61lbQIGOuYt5eyM=; b=h1XMgYMsBNPnRJU1aI57H7ZvsxBCwXML7DzzoICV1QTeyI4nN1IXvVxoBdaflgTQjt MddyPADt9c//GZKc/K699LPABITvNKelIndVRMexSVO2JyFeLpNGUKt3Ck/R3FTkPtNh 84rtLEbd57r233oyvsh1V5o8WnJhjvfDP39kBBkPPVroiQDreik1IG6tHif/SW5ayxR5 XbXaKeZkCFo2cChEWa3RSKvmvQJ5TVv8K+QH7UKC4T+SoO4viOkUIGQZ9jSVsg+9opaJ iKFVFii5vOHRcjSN1j5ydPEKOZA2wPt4/4liFWd0W6kxleeFLYvjov1S3cikk0PS+k7/ Td9Q== X-Gm-Message-State: AOAM5300mq9soNap5VRP+/dK9JgWhrPWfv+IfCluu8qUTWZr263oPNcr Q/mKvFbwy2Cx0nZBgE9FcM6X5UoZLjYrqXywX1GFI0gPhr75 X-Google-Smtp-Source: ABdhPJyW4uvls/pU6LN4B4s6Ah6NWPBPFO/nl8CuC7y9z1wq6FDvrEEOJ2OZJoqUqbbz58GaCWptrEh0rzbsQZmjpn4spUkbwUA6 MIME-Version: 1.0 X-Received: by 2002:a92:9687:: with SMTP id g129mr18004529ilh.219.1596088401058; Wed, 29 Jul 2020 22:53:21 -0700 (PDT) Date: Wed, 29 Jul 2020 22:53:21 -0700 X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <0000000000002ce2fc05aba24a7e@google.com> Subject: KASAN: invalid-free in snd_seq_port_disconnect From: syzbot To: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, perex@perex.cz, syzkaller-bugs@googlegroups.com, tiwai@suse.com Content-Type: text/plain; charset="UTF-8" X-Mailman-Approved-At: Fri, 31 Jul 2020 08:41:06 +0200 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Hello, syzbot found the following issue on: HEAD commit: d3590ebf Merge tag 'audit-pr-20200729' of git://git.kernel.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=1797d388900000 kernel config: https://syzkaller.appspot.com/x/.config?x=812bbfcb6ae2cd60 dashboard link: https://syzkaller.appspot.com/bug?extid=9d2abfef257f3e2d4713 compiler: clang version 10.0.0 (https://github.com/llvm/llvm-project/ c2443155a0fb245c8f17f2c1c72b6ea391e86e81) syz repro: https://syzkaller.appspot.com/x/repro.syz?x=14761be4900000 IMPORTANT: if you fix the issue, please add the following tag to the commit: Reported-by: syzbot+9d2abfef257f3e2d4713@syzkaller.appspotmail.com ================================================================== BUG: KASAN: double-free or invalid-free in snd_seq_port_disconnect+0x570/0x610 sound/core/seq/seq_ports.c:614 CPU: 1 PID: 7530 Comm: syz-executor.0 Not tainted 5.8.0-rc7-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1f0/0x31e lib/dump_stack.c:118 print_address_description+0x66/0x5a0 mm/kasan/report.c:383 kasan_report_invalid_free+0x54/0xd0 mm/kasan/report.c:477 __kasan_slab_free+0xae/0x170 mm/kasan/common.c:443 __cache_free mm/slab.c:3426 [inline] kfree+0x10a/0x220 mm/slab.c:3757 snd_seq_port_disconnect+0x570/0x610 sound/core/seq/seq_ports.c:614 snd_seq_ioctl_unsubscribe_port+0x349/0x6c0 sound/core/seq/seq_clientmgr.c:1525 snd_seq_oss_midi_close+0x397/0x620 sound/core/seq/oss/seq_oss_midi.c:405 snd_seq_oss_synth_reset+0x335/0x8b0 sound/core/seq/oss/seq_oss_synth.c:406 snd_seq_oss_reset+0x5b/0x250 sound/core/seq/oss/seq_oss_init.c:435 snd_seq_oss_ioctl+0x5c2/0x1090 sound/core/seq/oss/seq_oss_ioctl.c:93 odev_ioctl+0x51/0x70 sound/core/seq/oss/seq_oss.c:174 vfs_ioctl fs/ioctl.c:48 [inline] ksys_ioctl fs/ioctl.c:753 [inline] __do_sys_ioctl fs/ioctl.c:762 [inline] __se_sys_ioctl+0xf9/0x160 fs/ioctl.c:760 do_syscall_64+0x73/0xe0 arch/x86/entry/common.c:384 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x45c429 Code: 8d b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 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 0f 83 5b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f25d0cb3c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00000000000154c0 RCX: 000000000045c429 RDX: 0000000000000000 RSI: 0000000000005100 RDI: 0000000000000003 RBP: 000000000078bfd8 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000078bfac R13: 00007ffe03b9f5df R14: 00007f25d0cb49c0 R15: 000000000078bfac Allocated by task 7529: save_stack mm/kasan/common.c:48 [inline] set_track mm/kasan/common.c:56 [inline] __kasan_kmalloc+0x103/0x140 mm/kasan/common.c:494 kmem_cache_alloc_trace+0x234/0x300 mm/slab.c:3551 kmalloc include/linux/slab.h:555 [inline] kzalloc include/linux/slab.h:669 [inline] snd_seq_port_connect+0x66/0x460 sound/core/seq/seq_ports.c:553 snd_seq_ioctl_subscribe_port+0x349/0x6c0 sound/core/seq/seq_clientmgr.c:1484 snd_seq_oss_midi_open+0x4db/0x830 sound/core/seq/oss/seq_oss_midi.c:364 snd_seq_oss_synth_setup_midi+0x108/0x510 sound/core/seq/oss/seq_oss_synth.c:269 snd_seq_oss_open+0x899/0xe90 sound/core/seq/oss/seq_oss_init.c:261 odev_open+0x5e/0x90 sound/core/seq/oss/seq_oss.c:125 chrdev_open+0x498/0x580 fs/char_dev.c:414 do_dentry_open+0x813/0x1070 fs/open.c:828 do_open fs/namei.c:3243 [inline] path_openat+0x278d/0x37f0 fs/namei.c:3360 do_filp_open+0x191/0x3a0 fs/namei.c:3387 do_sys_openat2+0x463/0x770 fs/open.c:1179 do_sys_open fs/open.c:1195 [inline] __do_sys_openat fs/open.c:1209 [inline] __se_sys_openat fs/open.c:1204 [inline] __x64_sys_openat+0x1c8/0x1f0 fs/open.c:1204 do_syscall_64+0x73/0xe0 arch/x86/entry/common.c:384 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 7529: save_stack mm/kasan/common.c:48 [inline] set_track mm/kasan/common.c:56 [inline] kasan_set_free_info mm/kasan/common.c:316 [inline] __kasan_slab_free+0x114/0x170 mm/kasan/common.c:455 __cache_free mm/slab.c:3426 [inline] kfree+0x10a/0x220 mm/slab.c:3757 snd_seq_port_disconnect+0x570/0x610 sound/core/seq/seq_ports.c:614 snd_seq_ioctl_unsubscribe_port+0x349/0x6c0 sound/core/seq/seq_clientmgr.c:1525 snd_seq_oss_midi_close+0x397/0x620 sound/core/seq/oss/seq_oss_midi.c:405 snd_seq_oss_synth_reset+0x335/0x8b0 sound/core/seq/oss/seq_oss_synth.c:406 snd_seq_oss_reset+0x5b/0x250 sound/core/seq/oss/seq_oss_init.c:435 snd_seq_oss_ioctl+0x5c2/0x1090 sound/core/seq/oss/seq_oss_ioctl.c:93 odev_ioctl+0x51/0x70 sound/core/seq/oss/seq_oss.c:174 vfs_ioctl fs/ioctl.c:48 [inline] ksys_ioctl fs/ioctl.c:753 [inline] __do_sys_ioctl fs/ioctl.c:762 [inline] __se_sys_ioctl+0xf9/0x160 fs/ioctl.c:760 do_syscall_64+0x73/0xe0 arch/x86/entry/common.c:384 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The buggy address belongs to the object at ffff8880a3acdd00 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 0 bytes inside of 128-byte region [ffff8880a3acdd00, ffff8880a3acdd80) The buggy address belongs to the page: page:ffffea00028eb340 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 flags: 0xfffe0000000200(slab) raw: 00fffe0000000200 ffffea00025c5208 ffffea0002a371c8 ffff8880aa400700 raw: 0000000000000000 ffff8880a3acd000 0000000100000010 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a3acdc00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880a3acdc80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880a3acdd00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880a3acdd80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880a3acde00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== --- 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