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=-11.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL 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 8F4A2C5519F for ; Mon, 16 Nov 2020 11:11:30 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CF7CA22265 for ; Mon, 16 Nov 2020 11:11:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="dfYugB5q" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CF7CA22265 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0AAFB6B0036; Mon, 16 Nov 2020 06:11:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 05C1A6B005D; Mon, 16 Nov 2020 06:11:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E64EF6B0068; Mon, 16 Nov 2020 06:11:28 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0132.hostedemail.com [216.40.44.132]) by kanga.kvack.org (Postfix) with ESMTP id B703C6B0036 for ; Mon, 16 Nov 2020 06:11:28 -0500 (EST) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 60388180AD81D for ; Mon, 16 Nov 2020 11:11:28 +0000 (UTC) X-FDA: 77490015456.06.soda03_130fdb127328 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin06.hostedemail.com (Postfix) with ESMTP id 2A0CA1003CD17 for ; Mon, 16 Nov 2020 11:11:28 +0000 (UTC) X-HE-Tag: soda03_130fdb127328 X-Filterd-Recvd-Size: 11256 Received: from mail-qk1-f195.google.com (mail-qk1-f195.google.com [209.85.222.195]) by imf41.hostedemail.com (Postfix) with ESMTP for ; Mon, 16 Nov 2020 11:11:27 +0000 (UTC) Received: by mail-qk1-f195.google.com with SMTP id k4so6429647qko.13 for ; Mon, 16 Nov 2020 03:11:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fSyWfHMbqsw8Zkd0DQKyrHH6W5HuZEjs3rsVI0VZGww=; b=dfYugB5qvGr57g4YL3GEW6fNCws4rmjQ/IxqVRxNXnBnDliyX67BXekn4wlUMegniY 9vsCMSN/+SfrW4E7lqSROs2t5gViZuPeoylpJDTs8JLOymbx8XeHGAhZsU2jAmQ3PG6I jMesNJXk188H4jHwHcw6OG2Lb4NqYnHsaanCHGWxaIRgeI97Uq2sMSDuO1vh7phb9R3r Y/RsbPG/372nxGqnOqhxJwQk7anl+C6EMWVdVyo/2ChyxaPWl190Hi6aL2EqMbQ/pZkw jZxYvCFDHpNkCrBnN3Wf11OYq2OVSkZRmJAbnD2GXdqgB6im60vxXasR7FfOPmh3ijEA F/OA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fSyWfHMbqsw8Zkd0DQKyrHH6W5HuZEjs3rsVI0VZGww=; b=Ge6BJ5eYvcH5Ey9OZKKAlYntyVYYyWiKrkZE3EqyORQM0A1iVbA2j0L0C7n3FdNlo1 llL0QBJOUecu27kEPYe175UL+iuBHqXANxUhGBysAI7yZHFLnVmtIlJk57XKKw6tcF2o YrimZSGo8vW7RV384PB3e1GgCSPuc7f7yqxHunilOCzpxPqr2s03uvOcnJtdRt4gGq/+ VZyaiBW3xpoWCZjOc0geU0JC38z1CtLQk7za3bhngV+Z7TO2maajvCQjrANz+g8seRYb ZrqkrzNfCU4qazChQNqqAgVSuKxgfZylVCxl1iWayi6e7e1C/pZj+ftoxaBxHb3Q5hJp c3gA== X-Gm-Message-State: AOAM530P/GLcwIG6gMCGL+F2jMTWu1j68jcbKIto3mcLN6hUbcjNenwE PsUdd/AQBvzktjyXamReMOGSpZhxtOm8rQJHDyXFPQ== X-Google-Smtp-Source: ABdhPJw2aA4znWI4ahsXM30ZWQu9uSOxkyqTDr2sMEfhc6CDl5Gnn/Ggq0vogUKle5msVJrKgBx78hNIISVbQFEVpJg= X-Received: by 2002:a37:49d6:: with SMTP id w205mr13948885qka.501.1605525086672; Mon, 16 Nov 2020 03:11:26 -0800 (PST) MIME-Version: 1.0 References: <0000000000006ef45b05b436ddb4@google.com> In-Reply-To: <0000000000006ef45b05b436ddb4@google.com> From: Dmitry Vyukov Date: Mon, 16 Nov 2020 12:11:15 +0100 Message-ID: Subject: Re: KASAN: invalid-free in p9_client_create To: syzbot , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Linux-MM Cc: Dominique Martinet , David Miller , Eric Van Hensbergen , Jakub Kicinski , LKML , Latchesar Ionkov , netdev , syzkaller-bugs , v9fs-developer@lists.sourceforge.net Content-Type: text/plain; charset="UTF-8" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Nov 16, 2020 at 11:30 AM syzbot wrote: > > Hello, > > syzbot found the following issue on: > > HEAD commit: 92edc4ae Add linux-next specific files for 20201113 > git tree: linux-next > console output: https://syzkaller.appspot.com/x/log.txt?x=142f8816500000 > kernel config: https://syzkaller.appspot.com/x/.config?x=79ad4f8ad2d96176 > dashboard link: https://syzkaller.appspot.com/bug?extid=3a0f6c96e37e347c6ba9 > 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+3a0f6c96e37e347c6ba9@syzkaller.appspotmail.com Looks like a real double free in slab code. +MM maintainers Note there was a preceding kmalloc failure in sysfs_slab_add. > RBP: 00007fa358076ca0 R08: 0000000020000080 R09: 0000000000000000 > R10: 0000000000000000 R11: 0000000000000246 R12: 000000000000001f > R13: 00007fff7dcf224f R14: 00007fa3580779c0 R15: 000000000118bf2c > kobject_add_internal failed for 9p-fcall-cache (error: -12 parent: slab) > ================================================================== > BUG: KASAN: double-free or invalid-free in slab_free mm/slub.c:3157 [inline] > BUG: KASAN: double-free or invalid-free in kmem_cache_free+0x82/0x350 mm/slub.c:3173 > > CPU: 0 PID: 15981 Comm: syz-executor.5 Not tainted 5.10.0-rc3-next-20201113-syzkaller #0 > Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 > Call Trace: > __dump_stack lib/dump_stack.c:79 [inline] > dump_stack+0x107/0x163 lib/dump_stack.c:120 > print_address_description.constprop.0.cold+0x5b/0x2f8 mm/kasan/report.c:230 > kasan_report_invalid_free+0x51/0x80 mm/kasan/report.c:355 > ____kasan_slab_free+0x100/0x110 mm/kasan/common.c:352 > kasan_slab_free include/linux/kasan.h:194 [inline] > slab_free_hook mm/slub.c:1548 [inline] > slab_free_freelist_hook+0x5d/0x150 mm/slub.c:1586 > slab_free mm/slub.c:3157 [inline] > kmem_cache_free+0x82/0x350 mm/slub.c:3173 > create_cache mm/slab_common.c:274 [inline] > kmem_cache_create_usercopy+0x2ab/0x300 mm/slab_common.c:357 > p9_client_create+0xc4d/0x10c0 net/9p/client.c:1063 > v9fs_session_init+0x1dd/0x1770 fs/9p/v9fs.c:406 > v9fs_mount+0x79/0x9b0 fs/9p/vfs_super.c:126 > legacy_get_tree+0x105/0x220 fs/fs_context.c:592 > vfs_get_tree+0x89/0x2f0 fs/super.c:1549 > do_new_mount fs/namespace.c:2896 [inline] > path_mount+0x12ae/0x1e70 fs/namespace.c:3227 > do_mount fs/namespace.c:3240 [inline] > __do_sys_mount fs/namespace.c:3448 [inline] > __se_sys_mount fs/namespace.c:3425 [inline] > __x64_sys_mount+0x27f/0x300 fs/namespace.c:3425 > do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 > entry_SYSCALL_64_after_hwframe+0x44/0xa9 > RIP: 0033:0x45deb9 > Code: 0d b4 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 db b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00 > RSP: 002b:00007fa358076c78 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 > RAX: ffffffffffffffda RBX: 0000000000021800 RCX: 000000000045deb9 > RDX: 0000000020000100 RSI: 0000000020000040 RDI: 0000000000000000 > RBP: 00007fa358076ca0 R08: 0000000020000080 R09: 0000000000000000 > R10: 0000000000000000 R11: 0000000000000246 R12: 000000000000001f > R13: 00007fff7dcf224f R14: 00007fa3580779c0 R15: 000000000118bf2c > > Allocated by task 15981: > kasan_save_stack+0x1b/0x40 mm/kasan/common.c:39 > kasan_set_track mm/kasan/common.c:47 [inline] > set_alloc_info mm/kasan/common.c:403 [inline] > ____kasan_kmalloc.constprop.0+0x82/0xa0 mm/kasan/common.c:434 > kasan_slab_alloc include/linux/kasan.h:211 [inline] > slab_post_alloc_hook mm/slab.h:512 [inline] > slab_alloc_node mm/slub.c:2903 [inline] > slab_alloc mm/slub.c:2911 [inline] > kmem_cache_alloc+0x12a/0x470 mm/slub.c:2916 > kmem_cache_zalloc include/linux/slab.h:672 [inline] > create_cache mm/slab_common.c:251 [inline] > kmem_cache_create_usercopy+0x1a6/0x300 mm/slab_common.c:357 > p9_client_create+0xc4d/0x10c0 net/9p/client.c:1063 > v9fs_session_init+0x1dd/0x1770 fs/9p/v9fs.c:406 > v9fs_mount+0x79/0x9b0 fs/9p/vfs_super.c:126 > legacy_get_tree+0x105/0x220 fs/fs_context.c:592 > vfs_get_tree+0x89/0x2f0 fs/super.c:1549 > do_new_mount fs/namespace.c:2896 [inline] > path_mount+0x12ae/0x1e70 fs/namespace.c:3227 > do_mount fs/namespace.c:3240 [inline] > __do_sys_mount fs/namespace.c:3448 [inline] > __se_sys_mount fs/namespace.c:3425 [inline] > __x64_sys_mount+0x27f/0x300 fs/namespace.c:3425 > do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 > entry_SYSCALL_64_after_hwframe+0x44/0xa9 > > Freed by task 15981: > kasan_save_stack+0x1b/0x40 mm/kasan/common.c:39 > kasan_set_track+0x1c/0x30 mm/kasan/common.c:47 > kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:359 > ____kasan_slab_free+0xe1/0x110 mm/kasan/common.c:373 > kasan_slab_free include/linux/kasan.h:194 [inline] > slab_free_hook mm/slub.c:1548 [inline] > slab_free_freelist_hook+0x5d/0x150 mm/slub.c:1586 > slab_free mm/slub.c:3157 [inline] > kmem_cache_free+0x82/0x350 mm/slub.c:3173 > kobject_cleanup lib/kobject.c:705 [inline] > kobject_release lib/kobject.c:736 [inline] > kref_put include/linux/kref.h:65 [inline] > kobject_put+0x1c8/0x540 lib/kobject.c:753 > sysfs_slab_add+0x164/0x1d0 mm/slub.c:5656 > __kmem_cache_create+0x471/0x5a0 mm/slub.c:4476 > create_cache mm/slab_common.c:262 [inline] > kmem_cache_create_usercopy+0x1ed/0x300 mm/slab_common.c:357 > p9_client_create+0xc4d/0x10c0 net/9p/client.c:1063 > v9fs_session_init+0x1dd/0x1770 fs/9p/v9fs.c:406 > v9fs_mount+0x79/0x9b0 fs/9p/vfs_super.c:126 > legacy_get_tree+0x105/0x220 fs/fs_context.c:592 > vfs_get_tree+0x89/0x2f0 fs/super.c:1549 > do_new_mount fs/namespace.c:2896 [inline] > path_mount+0x12ae/0x1e70 fs/namespace.c:3227 > do_mount fs/namespace.c:3240 [inline] > __do_sys_mount fs/namespace.c:3448 [inline] > __se_sys_mount fs/namespace.c:3425 [inline] > __x64_sys_mount+0x27f/0x300 fs/namespace.c:3425 > do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 > entry_SYSCALL_64_after_hwframe+0x44/0xa9 > > The buggy address belongs to the object at ffff888013a45b40 > which belongs to the cache kmem_cache of size 224 > The buggy address is located 0 bytes inside of > 224-byte region [ffff888013a45b40, ffff888013a45c20) > The buggy address belongs to the page: > page:00000000cfbbc7ff refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888013a45c80 pfn:0x13a45 > flags: 0xfff00000000200(slab) > raw: 00fff00000000200 dead000000000100 dead000000000122 ffff888010041000 > raw: ffff888013a45c80 00000000800c0004 00000001ffffffff 0000000000000000 > page dumped because: kasan: bad access detected > > Memory state around the buggy address: > ffff888013a45a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb > ffff888013a45a80: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc > >ffff888013a45b00: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb > ^ > ffff888013a45b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb > ffff888013a45c00: fb fb fb fb fc fc fc fc fc fc fc fc 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. > > -- > 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/0000000000006ef45b05b436ddb4%40google.com.