Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1986229imm; Thu, 23 Aug 2018 12:07:54 -0700 (PDT) X-Google-Smtp-Source: AA+uWPy8id1wCUum30re6/XRvwuYgpfTjmPT+hOA1huDYxIglKVrKM6+T3f5vIUUJjwo2Mr3e9NR X-Received: by 2002:aa7:83cd:: with SMTP id j13-v6mr63805580pfn.236.1535051274583; Thu, 23 Aug 2018 12:07:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535051274; cv=none; d=google.com; s=arc-20160816; b=rWHaV6LlNFH+M+8iyvTDKeYlDWUO4cVmE1Zq0vznnd5gPxfjTxdoWKuUvmvH/s6VGX pc4MLmBA0oB3PAT2FPgr/GFQaeyyX1sEdz5SZVQeu5CFEZaZmTnJZGMe6b55LQ1EvNd/ TqTxYjvHXXvFli3q3wAIFCNICTKyFCkayD/HX+CABQ4N3N2MJ+LKYF+81cbaR3TpPIRS 8YzwFsN+nowHtK9ZP8iEOMdzBM8f1S+XgzeUs8XxlRc+OvWtczGhlZfcQofAUYkuEpOD OjFVAhjNlCPc0j9RDjFtqyDmsgLuqtMyflkitUKvVbnZSycRJQcUziZk7tWpTN6Eg+VL Jmpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=SusfeJTz8tY9Nx6IvKXciWnn4CRxci9BYLbgfN6pUyk=; b=HUHTtSTTT9P+z0i6nlGy3UHkZXgndNsR+QKeZjP2lw8uhbfOOns0fXD+lmJ+O4n6EJ IQswRzuuJyh4pz2ICfxr7YUAo3lORFl5P/34OHmhLyJdN8+Tqhpt/OcOq2jnCBTpsgFt FiA2FQwkUify9Io+0SbJrdZoVT2QgUiGPub1EHlID7uW3Dbi+9YxsUhEum7LYpQiNZ4c dCnTghKGelNCIPJdKBMCc6gj6XTgJCpbEvXioSiGsPXtXNfIZDYUcPhCVxnIGE0hFFw3 jrEhIhI7SpLMU8Uxiy6/Xf37Xc5KkrpXnTIbmEUypivXoat/KEgnivtEMjxWrIKl0jZG lMIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YoEdY77r; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y4-v6si4490330pgk.583.2018.08.23.12.07.38; Thu, 23 Aug 2018 12:07:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YoEdY77r; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727453AbeHWWhg (ORCPT + 99 others); Thu, 23 Aug 2018 18:37:36 -0400 Received: from mail-it0-f67.google.com ([209.85.214.67]:54980 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726636AbeHWWhg (ORCPT ); Thu, 23 Aug 2018 18:37:36 -0400 Received: by mail-it0-f67.google.com with SMTP id s7-v6so9019204itb.4; Thu, 23 Aug 2018 12:06:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=SusfeJTz8tY9Nx6IvKXciWnn4CRxci9BYLbgfN6pUyk=; b=YoEdY77rtbZlooTR2IEHNOBT+T8+9zPrAALAYaKnoXPuSVIQDfrk8I8igoyA9Ex/0A atyKvuxKBtOwrRqvThpnCLulOtTXYDkGVuZjnVYgBqWpMkCmidN1i4neNFquHR8hZw3N a/dcWnt4SaCHtO5itRHZbdBycJ00tiQtvAbJdlJbbWci9fdXJbT1wCMyurIvTCFgXB7Y ApbNwrEpstf01eBEs9Gxg6ldSvg7mwweFFinKeWV4bEaYib2jS93RVdUBavvGUewYBwY W4rzIhtPzLtXia+uvcYUTQXawXYvaBVtXSBW9l2G7PnWLoNZd0YOqeOjwyVbod9IEXXu lI7w== 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=SusfeJTz8tY9Nx6IvKXciWnn4CRxci9BYLbgfN6pUyk=; b=ZGND2gOcLSSekxSOtZ0on5bBrr2eavk6WSP21m1+ZB00kaC6I0HTAXb7j4kH85dJl8 zx4ew0gktCBKU76GsM5Y8hdlrdN3O9VOjR140Tc3qmfvjosLNABpmhe2+mEoreHnHgGA QiZjFkbepK+GWLfkdjbShP9Ponwfl9b+S+0g5i40x9UM+zXP4lubwiaS1o9CA9rgHQ1q 5JQVrFkBSXJKPpTdbJLfM2K+2AjpXKoWTXGsPA/K4CQW++OWXqAfgAvU7NUkNkB50KIt MyzsEZHh9IdfCYyw2vVPfVWOvn0JCQ/pGDWOeMOScmGIRmTiofuM0EJsAUgvHXE819S6 dbAQ== X-Gm-Message-State: APzg51AjvB4tYE4uC0D+o38yCFuhW2snmdfLFpLQPYDnd4S1rAc74p7/ EPdzWVDchLi6XRL144FJlNEUJObnES7P3K3cF9T6I7lz X-Received: by 2002:a24:8b82:: with SMTP id g124-v6mr7216339ite.70.1535051192233; Thu, 23 Aug 2018 12:06:32 -0700 (PDT) MIME-Version: 1.0 References: <0000000000002a37a205741b2ae1@google.com> In-Reply-To: <0000000000002a37a205741b2ae1@google.com> From: Ilya Dryomov Date: Thu, 23 Aug 2018 21:06:21 +0200 Message-ID: Subject: Re: KASAN: use-after-free Read in ceph_destroy_options To: syzbot+8ab6f1042021b4eed062@syzkaller.appspotmail.com Cc: Ceph Development , "David S. Miller" , linux-kernel@vger.kernel.org, netdev , Sage Weil , syzkaller-bugs@googlegroups.com, "Yan, Zheng" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 23, 2018 at 4:35 PM syzbot wrote: > > Hello, > > syzbot found the following crash on: > > HEAD commit: cc3d190b12b3 Add linux-next specific files for 20180822 > git tree: linux-next > console output: https://syzkaller.appspot.com/x/log.txt?x=107d322e400000 > kernel config: https://syzkaller.appspot.com/x/.config?x=ce7f661707bc9904 > dashboard link: https://syzkaller.appspot.com/bug?extid=8ab6f1042021b4eed062 > compiler: gcc (GCC) 8.0.1 20180413 (experimental) > > Unfortunately, I don't have any reproducer for this crash yet. > > IMPORTANT: if you fix the bug, please add the following tag to the commit: > Reported-by: syzbot+8ab6f1042021b4eed062@syzkaller.appspotmail.com > > ================================================================== > BUG: KASAN: use-after-free in ceph_destroy_options+0xe0/0x110 > net/ceph/ceph_common.c:289 > Read of size 8 at addr ffff8801d8f4dd50 by task syz-executor2/7977 > > CPU: 0 PID: 7977 Comm: syz-executor2 Not tainted 4.18.0-next-20180822+ #45 > 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+0x1c9/0x2b4 lib/dump_stack.c:113 > print_address_description+0x6c/0x20b mm/kasan/report.c:256 > kasan_report_error mm/kasan/report.c:354 [inline] > kasan_report.cold.7+0x242/0x30d mm/kasan/report.c:412 > __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433 > ceph_destroy_options+0xe0/0x110 net/ceph/ceph_common.c:289 > ceph_mount+0xeab/0x1cc0 fs/ceph/super.c:1047 > legacy_get_tree+0x131/0x460 fs/fs_context.c:732 > vfs_get_tree+0x1cb/0x5c0 fs/super.c:1746 > do_new_mount fs/namespace.c:2627 [inline] > do_mount+0x6f9/0x1e30 fs/namespace.c:2951 > ksys_mount+0x12d/0x140 fs/namespace.c:3167 > __do_sys_mount fs/namespace.c:3181 [inline] > __se_sys_mount fs/namespace.c:3178 [inline] > __x64_sys_mount+0xbe/0x150 fs/namespace.c:3178 > do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 > entry_SYSCALL_64_after_hwframe+0x49/0xbe > RIP: 0033:0x457089 > Code: fd 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 cb b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 > RSP: 002b:00007fae7dd45c78 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 > RAX: ffffffffffffffda RBX: 00007fae7dd466d4 RCX: 0000000000457089 > RDX: 0000000020000080 RSI: 0000000020000040 RDI: 0000000020000000 > RBP: 00000000009300a0 R08: 00000000200000c0 R09: 0000000000000000 > R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff > R13: 00000000004d2750 R14: 00000000004c7bdf R15: 0000000000000000 > > Allocated by task 7977: > save_stack+0x43/0xd0 mm/kasan/kasan.c:448 > set_track mm/kasan/kasan.c:460 [inline] > kasan_kmalloc+0xc4/0xe0 mm/kasan/kasan.c:553 > kmem_cache_alloc_trace+0x152/0x730 mm/slab.c:3620 > kmalloc include/linux/slab.h:513 [inline] > kzalloc include/linux/slab.h:707 [inline] > ceph_parse_options+0xfe/0x1230 net/ceph/ceph_common.c:355 > parse_mount_options fs/ceph/super.c:491 [inline] > ceph_mount+0x4b9/0x1cc0 fs/ceph/super.c:1036 > legacy_get_tree+0x131/0x460 fs/fs_context.c:732 > vfs_get_tree+0x1cb/0x5c0 fs/super.c:1746 > do_new_mount fs/namespace.c:2627 [inline] > do_mount+0x6f9/0x1e30 fs/namespace.c:2951 > ksys_mount+0x12d/0x140 fs/namespace.c:3167 > __do_sys_mount fs/namespace.c:3181 [inline] > __se_sys_mount fs/namespace.c:3178 [inline] > __x64_sys_mount+0xbe/0x150 fs/namespace.c:3178 > do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 > entry_SYSCALL_64_after_hwframe+0x49/0xbe > > Freed by task 7977: > save_stack+0x43/0xd0 mm/kasan/kasan.c:448 > set_track mm/kasan/kasan.c:460 [inline] > __kasan_slab_free+0x11a/0x170 mm/kasan/kasan.c:521 > kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 > __cache_free mm/slab.c:3498 [inline] > kfree+0xd9/0x210 mm/slab.c:3813 > ceph_destroy_options+0xd4/0x110 net/ceph/ceph_common.c:295 > ceph_destroy_client+0x139/0x1a0 net/ceph/ceph_common.c:680 > create_fs_client fs/ceph/super.c:677 [inline] > ceph_mount+0xf6e/0x1cc0 fs/ceph/super.c:1043 > legacy_get_tree+0x131/0x460 fs/fs_context.c:732 > vfs_get_tree+0x1cb/0x5c0 fs/super.c:1746 > do_new_mount fs/namespace.c:2627 [inline] > do_mount+0x6f9/0x1e30 fs/namespace.c:2951 > ksys_mount+0x12d/0x140 fs/namespace.c:3167 > __do_sys_mount fs/namespace.c:3181 [inline] > __se_sys_mount fs/namespace.c:3178 [inline] > __x64_sys_mount+0xbe/0x150 fs/namespace.c:3178 > do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 > entry_SYSCALL_64_after_hwframe+0x49/0xbe > > The buggy address belongs to the object at ffff8801d8f4dc80 > which belongs to the cache kmalloc-256 of size 256 > The buggy address is located 208 bytes inside of > 256-byte region [ffff8801d8f4dc80, ffff8801d8f4dd80) > The buggy address belongs to the page: > page:ffffea000763d340 count:1 mapcount:0 mapping:ffff8801dac007c0 index:0x0 > flags: 0x2fffc0000000100(slab) > raw: 02fffc0000000100 ffffea0006c0e448 ffffea00072ca688 ffff8801dac007c0 > raw: 0000000000000000 ffff8801d8f4d000 000000010000000c 0000000000000000 > page dumped because: kasan: bad access detected > > Memory state around the buggy address: > ffff8801d8f4dc00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc > ffff8801d8f4dc80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb > > ffff8801d8f4dd00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb > ^ > ffff8801d8f4dd80: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb > ffff8801d8f4de00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb > ================================================================== Thanks for the report, I'll prepare a patch. Ilya