Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1020061imm; Wed, 6 Jun 2018 09:14:49 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKdJMUFUq0mDJtaUu/3ZDXsiecOG8IVJVHJGZnLXmAMxugDO0gXhli3SbEZhUcEu6w8Wjnl X-Received: by 2002:a65:5c89:: with SMTP id a9-v6mr3047099pgt.51.1528301689590; Wed, 06 Jun 2018 09:14:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528301689; cv=none; d=google.com; s=arc-20160816; b=AXwXRV4ITFIq158w7Pk8QfYV0jRQq9kHV1h/gztnuuDC4TRRSWBT6Pf5ayp2bp5p8W 1Vviho/dJ8dEfMa4rwKrev70tJysQCmTabSRfy7JtGk70boqtgzWCwoSPmv/h+mSUj52 viLZJKBA+pe/U91Rq689S/j9LyvJ2kADeHYBfQ5+lIKbB3E2qya13rv0Sr0IzuL41Hw3 44QFEaKke2FuDR1g23IuwvSLmZGNXZPSsbRLwqIrt6gXI/JEUJhmIgQg7Cu3kCf8itX7 LAZRwUs628u6whH3ALarTHAkSLAGmqXGlQoj3A8EwIRZMYxRIPCbORgC3KyZzn1Ldcbp wiOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:dkim-signature :arc-authentication-results; bh=Z/vTKPtkjz6HjHvlbGP+xZakiFVhHjnh1/G0hDcvSmI=; b=x07f3CaEP2sumzrOqX5Jrucloly8NCilmhUt/QQOxD7+tDCIAaCOkLKHL9rFhyPHEV ALId1WiQ9i718A7dW1QPyOjxQpO+fEBPHAUVlhiVKuY6JYVmE1SFxtgcF7Cj27NSe84R 7++VBio33MQglN+qC81+tLJpx5oXYNZDmoGytlqKgkGP1HN/6HUbAiD4fErTicgdpQbI Mwt4Uml3VRrBpXwFz/KVzYDQEEk0xaouVrj/cZ8XeqYdoHXlmFL5IV3yKI2xCnS9OOmg RVv2GavDeXOG20YOQZ9SZ9KATfwcctPQXBwH2kDz4kRrLL7AiUBRVg1sc9Ij10Yak0Mu KeBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=N35zAyLg; 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=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c12-v6si10705822pga.608.2018.06.06.09.14.32; Wed, 06 Jun 2018 09:14:49 -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=@oracle.com header.s=corp-2017-10-26 header.b=N35zAyLg; 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=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932818AbeFFQMf (ORCPT + 99 others); Wed, 6 Jun 2018 12:12:35 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:48072 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932552AbeFFQMb (ORCPT ); Wed, 6 Jun 2018 12:12:31 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w56G6J9Z028174; Wed, 6 Jun 2018 16:12:23 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=Z/vTKPtkjz6HjHvlbGP+xZakiFVhHjnh1/G0hDcvSmI=; b=N35zAyLg/94Wp3klTNLXdzF0Btl7z1JFED85uDXyFp7IZ2dbwhd4NEwV/AVnHXLH9xi1 MnpiguFb6P/tUv28yKgukDYELgdtquojpykwNcWppuLCXwdd7XbPIc0DQZSNUY10cTFe dY9CMlEZqNrn3whyLD/dGte9hF4d6pjUiw829H/ES9lvYMI+cpuIJIY7W0w45V9WmvA+ f52ercy2VjLsw6lIR7e8ovDPBhvot16neJN5xz0IFgn4wmUPJeEPkFjK0ESZ5A0n8Y5y bYdTFqyQ3lNGsjxHrbkSGb9m6xU5wttcfzmNv5PAt4wWgSgiCC/wgeTnxx/2uAgSsRaa uQ== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2120.oracle.com with ESMTP id 2jbvypncuv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 06 Jun 2018 16:12:22 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w56GCLqC020245 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 6 Jun 2018 16:12:21 GMT Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w56GCJGG026538; Wed, 6 Jun 2018 16:12:20 GMT Received: from [192.168.0.182] (/202.156.141.250) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 06 Jun 2018 09:12:19 -0700 Subject: Re: kernel BUG at fs/btrfs/volumes.c:LINE! To: syzbot , clm@fb.com, dsterba@suse.com, jbacik@fb.com, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com References: <00000000000096009b056df92dc1@google.com> From: Anand Jain Message-ID: <70a3c2d1-3f53-d4c0-13b3-29f836ec46d9@oracle.com> Date: Thu, 7 Jun 2018 00:15:04 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <00000000000096009b056df92dc1@google.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8916 signatures=668702 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=2 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1805220000 definitions=main-1806060183 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/06/2018 09:31 PM, syzbot wrote: > Hello, > > syzbot found the following crash on: > > HEAD commit:    af6c5d5e01ad Merge branch 'for-4.18' of > git://git.kernel.o.. > git tree:       upstream > console output: https://syzkaller.appspot.com/x/log.txt?x=15f700af800000 > kernel config:  https://syzkaller.appspot.com/x/.config?x=12ff770540994680 > dashboard link: > https://syzkaller.appspot.com/bug?extid=5b658d997a83984507a6 > 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+5b658d997a83984507a6@syzkaller.appspotmail.com > > RDX: 0000000020000080 RSI: 0000000020000040 RDI: 00007f787067fbf0 > RBP: 0000000000000001 R08: 00000000200000c0 R09: 0000000020000080 > R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000014 > R13: 0000000000000001 R14: 0000000000700008 R15: 0000000000000043 > ------------[ cut here ]------------ > kernel BUG at fs/btrfs/volumes.c:1032! > invalid opcode: 0000 [#1] SMP KASAN > CPU: 1 PID: 22303 Comm: syz-executor1 Not tainted 4.17.0+ #86 > Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS > Google 01/01/2011 > RIP: 0010:btrfs_prepare_close_one_device fs/btrfs/volumes.c:1032 [inline] btrfs_prepare_close_one_device() :: 1031 name = rcu_string_strdup(device->name->str, GFP_NOFS); 1032 BUG_ON(!name); /* -ENOMEM */ The way we close our devices needs new memory allocations at the time of device close. By doing this apart from the BUG_ON reported here, there _were_ other complications like managing the sysfs links and moving them to the newly allocated btrfs_fs_devices. So sometime back I attempted to correct this approach to a simple device close without fresh allocation, however it wasn't successful. I am going to try that again, but its not p1. Thanks, Anand > RIP: 0010:close_fs_devices+0xba7/0xfa0 fs/btrfs/volumes.c:1052 > Code: 56 18 48 89 f8 48 c1 e8 03 80 3c 18 00 0f 85 2b 03 00 00 49 83 6c > 24 30 01 e9 25 f8 ff ff e8 90 f4 b3 fe 0f 0b e8 89 f4 b3 fe <0f> 0b 48 > 89 f7 e8 ef 64 f0 fe e9 f6 f5 ff ff e8 75 f4 b3 fe 0f 0b > RSP: 0018:ffff8801af6ff050 EFLAGS: 00010246 > RAX: 0000000000040000 RBX: dffffc0000000000 RCX: ffffc9000c70c000 > RDX: 0000000000040000 RSI: ffffffff82c56437 RDI: 0000000000000286 > RBP: ffff8801af6ff350 R08: ffffed003b5e46d7 R09: ffffed003b5e46d6 > R10: ffffed003b5e46d6 R11: ffff8801daf236b3 R12: ffff8801c58ac190 > R13: 0000000000000000 R14: ffff8801b1a6a940 R15: ffff8801b4d7d680 > FS:  00007f7870680700(0000) GS:ffff8801daf00000(0000) > knlGS:0000000000000000 > CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > CR2: 0000000000704094 CR3: 00000001c51e8000 CR4: 00000000001406e0 > DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 > DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 > Call Trace: >  btrfs_close_devices+0x29/0x150 fs/btrfs/volumes.c:1085 >  btrfs_mount_root+0x1419/0x1e70 fs/btrfs/super.c:1610 >  mount_fs+0xae/0x328 fs/super.c:1277 >  vfs_kern_mount.part.34+0xd4/0x4d0 fs/namespace.c:1037 >  vfs_kern_mount+0x40/0x60 fs/namespace.c:1027 >  btrfs_mount+0x4a1/0x213e fs/btrfs/super.c:1661 >  mount_fs+0xae/0x328 fs/super.c:1277 >  vfs_kern_mount.part.34+0xd4/0x4d0 fs/namespace.c:1037 >  vfs_kern_mount fs/namespace.c:1027 [inline] >  do_new_mount fs/namespace.c:2518 [inline] >  do_mount+0x564/0x30b0 fs/namespace.c:2848 >  ksys_mount+0x12d/0x140 fs/namespace.c:3064 >  __do_sys_mount fs/namespace.c:3078 [inline] >  __se_sys_mount fs/namespace.c:3075 [inline] >  __x64_sys_mount+0xbe/0x150 fs/namespace.c:3075 >  do_syscall_64+0x1b1/0x800 arch/x86/entry/common.c:287 >  entry_SYSCALL_64_after_hwframe+0x49/0xbe > RIP: 0033:0x45843a > Code: b8 a6 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 dd 8f fb ff c3 66 2e > 0f 1f 84 00 00 00 00 00 66 90 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 > f0 ff ff 0f 83 ba 8f fb ff c3 66 0f 1f 84 00 00 00 00 00 > RSP: 002b:00007f787067fba8 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5 > RAX: ffffffffffffffda RBX: 0000000020000080 RCX: 000000000045843a > RDX: 0000000020000080 RSI: 0000000020000040 RDI: 00007f787067fbf0 > RBP: 0000000000000001 R08: 00000000200000c0 R09: 0000000020000080 > R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000014 > R13: 0000000000000001 R14: 0000000000700008 R15: 0000000000000043 > Modules linked in: > Dumping ftrace buffer: >    (ftrace buffer empty) > ---[ end trace 383b0406a01f2edd ]--- > RIP: 0010:btrfs_prepare_close_one_device fs/btrfs/volumes.c:1032 [inline] > RIP: 0010:close_fs_devices+0xba7/0xfa0 fs/btrfs/volumes.c:1052 > Code: 56 18 48 89 f8 48 c1 e8 03 80 3c 18 00 0f 85 2b 03 00 00 49 83 6c > 24 30 01 e9 25 f8 ff ff e8 90 f4 b3 fe 0f 0b e8 89 f4 b3 fe <0f> 0b 48 > 89 f7 e8 ef 64 f0 fe e9 f6 f5 ff ff e8 75 f4 b3 fe 0f 0b > RSP: 0018:ffff8801af6ff050 EFLAGS: 00010246 > RAX: 0000000000040000 RBX: dffffc0000000000 RCX: ffffc9000c70c000 > RDX: 0000000000040000 RSI: ffffffff82c56437 RDI: 0000000000000286 > RBP: ffff8801af6ff350 R08: ffffed003b5e46d7 R09: ffffed003b5e46d6 > R10: ffffed003b5e46d6 R11: ffff8801daf236b3 R12: ffff8801c58ac190 > R13: 0000000000000000 R14: ffff8801b1a6a940 R15: ffff8801b4d7d680 > FS:  00007f7870680700(0000) GS:ffff8801daf00000(0000) > knlGS:0000000000000000 > CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > CR2: 0000000000704094 CR3: 00000001c51e8000 CR4: 00000000001406e0 > DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 > DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 > > > --- > This bug 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 bug report. See: > https://goo.gl/tpsmEJ#bug-status-tracking for how to communicate with > syzbot. > -- > To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at  http://vger.kernel.org/majordomo-info.html