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.5 required=3.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,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 32264C43461 for ; Thu, 10 Sep 2020 04:17:51 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5C73E20719 for ; Thu, 10 Sep 2020 04:17:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5C73E20719 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sina.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 919F86B005C; Thu, 10 Sep 2020 00:17:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8CBBA6B0068; Thu, 10 Sep 2020 00:17:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7E1B56B006C; Thu, 10 Sep 2020 00:17:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0166.hostedemail.com [216.40.44.166]) by kanga.kvack.org (Postfix) with ESMTP id 65CA86B005C for ; Thu, 10 Sep 2020 00:17:49 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 2990E181AEF10 for ; Thu, 10 Sep 2020 04:17:49 +0000 (UTC) X-FDA: 77245843458.23.rings34_560be1b270e3 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin23.hostedemail.com (Postfix) with ESMTP id E71C837609 for ; Thu, 10 Sep 2020 04:17:48 +0000 (UTC) X-HE-Tag: rings34_560be1b270e3 X-Filterd-Recvd-Size: 5590 Received: from r3-18.sinamail.sina.com.cn (r3-18.sinamail.sina.com.cn [202.108.3.18]) by imf48.hostedemail.com (Postfix) with SMTP for ; Thu, 10 Sep 2020 04:17:46 +0000 (UTC) Received: from unknown (HELO localhost.localdomain)([61.51.227.158]) by sina.com with ESMTP id 5F59A8E60002179D; Thu, 10 Sep 2020 12:17:44 +0800 (CST) X-Sender: hdanton@sina.com X-Auth-ID: hdanton@sina.com X-SMAIL-MID: 26900915073458 From: Hillf Danton To: Souptick Joarder Cc: Hillf Danton , syzbot , Andrew Morton , linux-kernel@vger.kernel.org, Linux-MM , Miaohe Lin , syzkaller-bugs@googlegroups.com Subject: Re: general protection fault in unlink_file_vma Date: Thu, 10 Sep 2020 12:17:32 +0800 Message-Id: <20200910041732.11224-1-hdanton@sina.com> In-Reply-To: References: <000000000000f7793505aed666dc@google.com> <20200909041537.19628-1-hdanton@sina.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: E71C837609 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.001164, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, 10 Sep 2020 07:43:41 +0530 Souptick Joarder wrote: > On Wed, Sep 9, 2020 at 9:45 AM Hillf Danton wrote: > > Tue, 08 Sep 2020 17:19:17 -0700 > > > syzbot found the following issue on: > > > > > > HEAD commit: 59126901 Merge tag 'perf-tools-fixes-for-v5.9-2020-= 09-03' .. > > > git tree: upstream > > > console output: https://syzkaller.appspot.com/x/log.txt?x=3D1166cb5= d900000 > > > kernel config: https://syzkaller.appspot.com/x/.config?x=3D3c5f6ce= 8d5b68299 > > > dashboard link: https://syzkaller.appspot.com/bug?extid=3Dc5d5a51dc= bb558ca0cb5 > > > compiler: gcc (GCC) 10.1.0-syz 20200507 > > > syz repro: https://syzkaller.appspot.com/x/repro.syz?x=3D11901= e95900000 > > > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=3D15f5619= 5900000 > > > > > > Bisection is inconclusive: the issue happens on the oldest tested r= elease. > > > > > > bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=3D1205= faed900000 > > > final oops: https://syzkaller.appspot.com/x/report.txt?x=3D1105= faed900000 > > > console output: https://syzkaller.appspot.com/x/log.txt?x=3D1605fae= d900000 > > > > > > IMPORTANT: if you fix the issue, please add the following tag to th= e commit: > > > Reported-by: syzbot+c5d5a51dcbb558ca0cb5@syzkaller.appspotmail.com > > > > > > general protection fault, probably for non-canonical address 0xe00e= eaee0000003b: 0000 [#1] PREEMPT SMP KASAN > > > KASAN: maybe wild-memory-access in range [0x00777770000001d8-0x0077= 7770000001df] > > > CPU: 1 PID: 10488 Comm: syz-executor721 Not tainted 5.9.0-rc3-syzka= ller #0 > > > Hardware name: Google Google Compute Engine/Google Compute Engine, = BIOS Google 01/01/2011 > > > RIP: 0010:unlink_file_vma+0x57/0xb0 mm/mmap.c:164 > > > Code: 4c 8b a5 a0 00 00 00 4d 85 e4 74 4e e8 92 d7 cd ff 49 8d bc 2= 4 d8 01 00 00 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80> 3c = 02 00 75 3d 4d 8b b4 24 d8 01 00 00 4d 8d 6e 78 4c 89 ef e8 > > > RSP: 0018:ffffc9000ac0f9b0 EFLAGS: 00010202 > > > RAX: dffffc0000000000 RBX: ffff88800010ceb0 RCX: ffffffff81592421 > > > RDX: 000eeeee0000003b RSI: ffffffff81a6736e RDI: 00777770000001d8 > > > RBP: ffff88800010ceb0 R08: 0000000000000001 R09: ffff88801291a50f > > > R10: ffffed10025234a1 R11: 0000000000000001 R12: 0077777000000000 > > > R13: 00007f1eea0da000 R14: 00007f1eea0d9000 R15: 0000000000000000 > > > FS: 0000000000000000(0000) GS:ffff8880ae700000(0000) knlGS:0000000= 000000000 > > > CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > > > CR2: 00007f1eea11a9d0 CR3: 000000000007e000 CR4: 00000000001506e0 > > > DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 > > > DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 > > > Call Trace: > > > free_pgtables+0x1b3/0x2f0 mm/memory.c:415 > > > exit_mmap+0x2c0/0x530 mm/mmap.c:3184 > > > __mmput+0x122/0x470 kernel/fork.c:1076 > > > mmput+0x53/0x60 kernel/fork.c:1097 > > > exit_mm kernel/exit.c:483 [inline] > > > do_exit+0xa8b/0x29f0 kernel/exit.c:793 > > > do_group_exit+0x125/0x310 kernel/exit.c:903 > > > get_signal+0x428/0x1f00 kernel/signal.c:2757 > > > arch_do_signal+0x82/0x2520 arch/x86/kernel/signal.c:811 > > > exit_to_user_mode_loop kernel/entry/common.c:136 [inline] > > > exit_to_user_mode_prepare+0x1ae/0x200 kernel/entry/common.c:167 > > > syscall_exit_to_user_mode+0x7e/0x2e0 kernel/entry/common.c:242 > > > entry_SYSCALL_64_after_hwframe+0x44/0xa9 > > > > Looks like d70cec898324 ("mm: mmap: merge vma after call_mmap() if po= ssible") > > added an extra fput. >=20 > Can you please help me to understand how do you figure out this commit = ? Feel free to correct Hillf if I missed any thing. Failing to reproduce the gpf without the commit may tell us more about it than I could. > > > > --- a/mm/mmap.c > > +++ b/mm/mmap.c > > @@ -1781,7 +1781,6 @@ unsigned long mmap_region(struct file *f > > merge =3D vma_merge(mm, prev, vma->vm_start, = vma->vm_end, vma->vm_flags, > > NULL, vma->vm_file, vma->vm_pgoff, NU= LL, NULL_VM_UFFD_CTX); > > if (merge) { > > - fput(file); > > vm_area_free(vma); > > vma =3D merge; > > /* Update vm_flags and possible addr = to pick up the change. We don't