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=-3.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FROM_LOCAL_HEX,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 DBDD0C433DF for ; Thu, 27 Aug 2020 17:03:10 +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 6733E20737 for ; Thu, 27 Aug 2020 17:03:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="QLSl/QfR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6733E20737 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 D148C1838; Thu, 27 Aug 2020 19:02:18 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D148C1838 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1598547788; bh=ETXqdM9VJYmsFXZ75H4iFkwwFq0Y/W6Fn6itSsGCeBw=; h=Date:Subject:From:To:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=QLSl/QfREG8K2YUh3mdS3s4XiFB2OvpuEaCqI1N2TYm2ROZvzBCSO2kWTu/QlJDyZ CVP7+9vTCVwx8T3JEByV0qM53pEHoyezWvrT5ZlL3pdMpemXQsvzEnmoixDddPHUiR OsZ9OsV6/qyy/sAYspMBzAqO0vzM1iLisaTDueFQ= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 2785BF80363; Thu, 27 Aug 2020 18:51:20 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 07358F8016F; Thu, 27 Aug 2020 18:34:29 +0200 (CEST) Received: from mail-io1-f72.google.com (mail-io1-f72.google.com [209.85.166.72]) (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 1AFE8F80085 for ; Thu, 27 Aug 2020 18:34:17 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1AFE8F80085 Received: by mail-io1-f72.google.com with SMTP id x12so4186777iow.7 for ; Thu, 27 Aug 2020 09:34:17 -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=CeejWM1wsnx+eYnik6gMIrJziDJ/HbH2NxxTTf+OlEo=; b=Cka42pB6tPjLcXe9CYxyFnStuba2cjwa67lxcGU3RxeXmziVPLjFYvafOvBEL0YPFo EP8RXAFtv2KW9S/MvPObtBGGKb51gxebrTmjJfQEmdAeDP9JowSJFIyIrzqYv5zBGysy rBU3uAXRPoTAtTZzTKhwqSREa2/0qDihKsyBocnKlhgEvrJhI6rTNodf9h4ct+ENtWzT qFgv37GKOBZBQ9Rwx661bKnzVFJRR0W4sHUegvo1za1LLqI3MIb2jt0KmsaZnsZiHCJa pbOnJd0JwKFFl2QD1KQuEzA/i2k1WGafV5BCjNAtUzZYjNGyqD/qYXLPd2hs0E823uVC wyKA== X-Gm-Message-State: AOAM532AyAALYVfyMTu/dFD9Sy++lUVEoDpxmUP0EvHg+iLNc/bjnBjG yOhEGrLadpqF0iPVYRs+KZE2px68nLCug7wuiB7Vahu60LC/ X-Google-Smtp-Source: ABdhPJwHkrto7t0X1WgI6fFrkVMbX4Uvg4rR0wAtL+dlrFnlUcoF9NqNwCZped76HCsV5Uryb/Pn3h1YMIx/Dt1YLvEIpkdKkk/J MIME-Version: 1.0 X-Received: by 2002:a92:da07:: with SMTP id z7mr11323378ilm.196.1598546055601; Thu, 27 Aug 2020 09:34:15 -0700 (PDT) Date: Thu, 27 Aug 2020 09:34:15 -0700 X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <000000000000cd24b305adde81ff@google.com> Subject: KASAN: use-after-free Read in snd_pcm_oss_release From: syzbot To: akpm@linux-foundation.org, alsa-devel@alsa-project.org, arnd@arndb.de, gustavoars@kernel.org, linux-kernel@vger.kernel.org, perex@perex.cz, syzkaller-bugs@googlegroups.com, tiwai@suse.com, vbabka@suse.cz, walken@google.com Content-Type: text/plain; charset="UTF-8" X-Mailman-Approved-At: Thu, 27 Aug 2020 18:50:46 +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: f37be724 Add linux-next specific files for 20200826 git tree: linux-next console output: https://syzkaller.appspot.com/x/log.txt?x=137c7cb9900000 kernel config: https://syzkaller.appspot.com/x/.config?x=1e5a1cf036089d95 dashboard link: https://syzkaller.appspot.com/bug?extid=12a3fcd1493ec6585007 compiler: gcc (GCC) 10.1.0-syz 20200507 Unfortunately, I don't have any reproducer for this issue yet. IMPORTANT: if you fix the issue, please add the following tag to the commit: Reported-by: syzbot+12a3fcd1493ec6585007@syzkaller.appspotmail.com ================================================================== BUG: KASAN: use-after-free in snd_pcm_oss_release_file sound/core/oss/pcm_oss.c:2367 [inline] BUG: KASAN: use-after-free in snd_pcm_oss_release_file sound/core/oss/pcm_oss.c:2361 [inline] BUG: KASAN: use-after-free in snd_pcm_oss_release+0x28d/0x300 sound/core/oss/pcm_oss.c:2548 Read of size 8 at addr ffff888026b66480 by task syz-executor.1/27751 CPU: 1 PID: 27751 Comm: syz-executor.1 Not tainted 5.9.0-rc2-next-20200826-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+0x18f/0x20d lib/dump_stack.c:118 print_address_description.constprop.0.cold+0xae/0x497 mm/kasan/report.c:383 __kasan_report mm/kasan/report.c:513 [inline] kasan_report.cold+0x1f/0x37 mm/kasan/report.c:530 snd_pcm_oss_release_file sound/core/oss/pcm_oss.c:2367 [inline] snd_pcm_oss_release_file sound/core/oss/pcm_oss.c:2361 [inline] snd_pcm_oss_release+0x28d/0x300 sound/core/oss/pcm_oss.c:2548 __fput+0x285/0x920 fs/file_table.c:281 task_work_run+0xdd/0x190 kernel/task_work.c:141 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_user_mode_loop kernel/entry/common.c:140 [inline] exit_to_user_mode_prepare+0x195/0x1c0 kernel/entry/common.c:167 syscall_exit_to_user_mode+0x59/0x2b0 kernel/entry/common.c:242 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x416f01 Code: 75 14 b8 03 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 04 1b 00 00 c3 48 83 ec 08 e8 0a fc ff ff 48 89 04 24 b8 03 00 00 00 0f 05 <48> 8b 3c 24 48 89 c2 e8 53 fc ff ff 48 89 d0 48 83 c4 08 48 3d 01 RSP: 002b:00007ffdd39a5e70 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 0000000000000004 RCX: 0000000000416f01 RDX: 0000000000000001 RSI: 0000000001190428 RDI: 0000000000000003 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 00007ffdd39a5f60 R11: 0000000000000293 R12: 0000000001190428 R13: 0000000000268c54 R14: ffffffffffffffff R15: 000000000118cfec Allocated by task 27754: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_set_track mm/kasan/common.c:56 [inline] __kasan_kmalloc.constprop.0+0xbf/0xd0 mm/kasan/common.c:461 kmem_cache_alloc_trace+0x16e/0x2c0 mm/slab.c:3550 kmalloc include/linux/slab.h:554 [inline] kzalloc include/linux/slab.h:666 [inline] snd_pcm_oss_open_file sound/core/oss/pcm_oss.c:2389 [inline] snd_pcm_oss_open.part.0+0x55e/0x1290 sound/core/oss/pcm_oss.c:2491 snd_pcm_oss_open+0x3c/0x50 sound/core/oss/pcm_oss.c:2455 soundcore_open+0x445/0x600 sound/sound_core.c:593 chrdev_open+0x266/0x770 fs/char_dev.c:414 do_dentry_open+0x4b9/0x11b0 fs/open.c:817 do_open fs/namei.c:3251 [inline] path_openat+0x1b9a/0x2730 fs/namei.c:3368 do_filp_open+0x17e/0x3c0 fs/namei.c:3395 do_sys_openat2+0x16d/0x420 fs/open.c:1168 do_sys_open fs/open.c:1184 [inline] __do_sys_openat fs/open.c:1200 [inline] __se_sys_openat fs/open.c:1195 [inline] __x64_sys_openat+0x13f/0x1f0 fs/open.c:1195 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 27754: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_set_track+0x1c/0x30 mm/kasan/common.c:56 kasan_set_free_info+0x1b/0x30 mm/kasan/generic.c:355 __kasan_slab_free+0xd8/0x120 mm/kasan/common.c:422 __cache_free mm/slab.c:3418 [inline] kfree+0x103/0x2c0 mm/slab.c:3756 snd_pcm_oss_release_file sound/core/oss/pcm_oss.c:2371 [inline] snd_pcm_oss_release_file sound/core/oss/pcm_oss.c:2361 [inline] snd_pcm_oss_release+0x17e/0x300 sound/core/oss/pcm_oss.c:2548 __fput+0x285/0x920 fs/file_table.c:281 task_work_run+0xdd/0x190 kernel/task_work.c:141 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_user_mode_loop kernel/entry/common.c:140 [inline] exit_to_user_mode_prepare+0x195/0x1c0 kernel/entry/common.c:167 syscall_exit_to_user_mode+0x59/0x2b0 kernel/entry/common.c:242 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The buggy address belongs to the object at ffff888026b66480 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 0 bytes inside of 32-byte region [ffff888026b66480, ffff888026b664a0) The buggy address belongs to the page: page:0000000076bbbb49 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888026b66fc1 pfn:0x26b66 flags: 0xfffe0000000200(slab) raw: 00fffe0000000200 ffffea0002385208 ffffea0000782448 ffff8880aa040100 raw: ffff888026b66fc1 ffff888026b66000 000000010000002e 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888026b66380: fa fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ffff888026b66400: 00 fc fc fc fc fc fc fc 00 00 00 00 fc fc fc fc >ffff888026b66480: fa fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ^ ffff888026b66500: 00 fc fc fc fc fc fc fc 00 fc fc fc fc fc fc fc ffff888026b66580: fa fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ================================================================== --- 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.