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=-4.0 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 ADF21C433E0 for ; Thu, 23 Jul 2020 07:38:07 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2E23A206C1 for ; Thu, 23 Jul 2020 07:38:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2E23A206C1 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 720146B0002; Thu, 23 Jul 2020 03:38:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6F6946B0005; Thu, 23 Jul 2020 03:38:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6334E6B0006; Thu, 23 Jul 2020 03:38:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0023.hostedemail.com [216.40.44.23]) by kanga.kvack.org (Postfix) with ESMTP id 4D9AA6B0002 for ; Thu, 23 Jul 2020 03:38:06 -0400 (EDT) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id ECF531846F755 for ; Thu, 23 Jul 2020 07:38:05 +0000 (UTC) X-FDA: 77068536930.02.truck68_520d56526f3c Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin02.hostedemail.com (Postfix) with ESMTP id C672F10099389 for ; Thu, 23 Jul 2020 07:38:05 +0000 (UTC) X-HE-Tag: truck68_520d56526f3c X-Filterd-Recvd-Size: 5997 Received: from mail3-167.sinamail.sina.com.cn (mail3-167.sinamail.sina.com.cn [202.108.3.167]) by imf45.hostedemail.com (Postfix) with SMTP for ; Thu, 23 Jul 2020 07:38:02 +0000 (UTC) Received: from unknown (HELO localhost.localdomain)([123.115.165.95]) by sina.com with ESMTP id 5F193E520002A375; Thu, 23 Jul 2020 15:37:59 +0800 (CST) X-Sender: hdanton@sina.com X-Auth-ID: hdanton@sina.com X-SMAIL-MID: 95514629039 From: Hillf Danton To: "Kirill A. Shutemov" Cc: Andrew Morton , syzbot , linux-kernel@vger.kernel.org, linux-mm@kvack.org, syzkaller-bugs@googlegroups.com, Mike Kravetz , Johannes Weiner , Jens Axboe , Markus Elfring , Hillf Danton Subject: Re: kernel BUG at include/linux/swapops.h:LINE! Date: Thu, 23 Jul 2020 15:37:44 +0800 Message-Id: <20200723073744.5268-1-hdanton@sina.com> In-Reply-To: <20200721111131.bo3g6qkcvbhpupon@black.fi.intel.com> References: <000000000000bc4fd705a6e090e2@google.com> <0000000000004c38cd05aad1d13f@google.com> <20200720165144.93189f7825bd28e234a42cb8@linux-foundation.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: C672F10099389 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000295, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, 21 Jul 2020 14:11:31 +0300 Kirill A. Shutemov wrote: > On Mon, Jul 20, 2020 at 04:51:44PM -0700, Andrew Morton wrote: > > On Sun, 19 Jul 2020 14:10:19 -0700 syzbot wrote: > >=20 > > > syzbot has found a reproducer for the following issue on: > > >=20 > > > HEAD commit: 4c43049f Add linux-next specific files for 20200716 > > > git tree: linux-next > > > console output: https://syzkaller.appspot.com/x/log.txt?x=3D12c5608= 7100000 > > > kernel config: https://syzkaller.appspot.com/x/.config?x=3D2c76d72= 659687242 > > > dashboard link: https://syzkaller.appspot.com/bug?extid=3Dc48f34012= b06c4ac67dd > > > compiler: gcc (GCC) 10.1.0-syz 20200507 > > > syz repro: https://syzkaller.appspot.com/x/repro.syz?x=3D1344a= beb100000 > > >=20 > > > IMPORTANT: if you fix the issue, please add the following tag to th= e commit: > > > Reported-by: syzbot+c48f34012b06c4ac67dd@syzkaller.appspotmail.com > >=20 > > Thanks. > >=20 > > __handle_mm_fault > > ->pmd_migration_entry_wait > > ->migration_entry_to_page > >=20 > > stumbled onto an unlocked page. > >=20 > > I don't immediately see a cause. Perhaps Matthew's "THP prep patches= ", > > perhaps something else. > >=20 > > Is it possible to perform a bisection? >=20 > Maybe it's related to the new lock_page_async()? Or is there likely the window that after copy_huge_pmd() the src pmd migr= ate entry is removed and the page unlocked but the dst is not? > > > ------------[ cut here ]------------ > > > kernel BUG at include/linux/swapops.h:197! > > > invalid opcode: 0000 [#1] PREEMPT SMP KASAN > > > CPU: 1 PID: 19938 Comm: syz-executor.2 Not tainted 5.8.0-rc5-next-2= 0200716-syzkaller #0 > > > Hardware name: Google Google Compute Engine/Google Compute Engine, = BIOS Google 01/01/2011 > > > RIP: 0010:migration_entry_to_page include/linux/swapops.h:197 [inli= ne] > > > RIP: 0010:migration_entry_to_page include/linux/swapops.h:190 [inli= ne] > > > RIP: 0010:pmd_migration_entry_wait+0x493/0x520 mm/migrate.c:368 > > > Code: 4d 8d 66 ff e9 1f fe ff ff e8 b9 c4 be ff 49 8d 5f ff e9 58 f= e ff ff e8 ab c4 be ff 4d 8d 66 ff e9 a9 fe ff ff e8 9d c4 be ff <0f> 0b = e8 96 c4 be ff 0f 0b e8 8f c4 be ff 4c 8d 65 ff eb a7 48 89 > > > RSP: 0018:ffffc9001095fb70 EFLAGS: 00010293 > > > RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffffff81b56a24 > > > RDX: ffff888092022240 RSI: ffffffff81b56b43 RDI: 0000000000000001 > > > RBP: ffffea0008468080 R08: 0000000000000000 R09: ffffea0008468087 > > > R10: 0000000000000000 R11: 0000000000000000 R12: ffffea0008468080 > > > R13: ffff888015d2e0c0 R14: 0000000000000000 R15: 0000000000000000 > > > FS: 00007f55eb477700(0000) GS:ffff8880ae700000(0000) knlGS:0000000= 000000000 > > > CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > > > CR2: 0000000020000080 CR3: 000000021ad87000 CR4: 00000000001526e0 > > > DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 > > > DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 > > > Call Trace: > > > __handle_mm_fault mm/memory.c:4349 [inline] > > > handle_mm_fault+0x23cf/0x45e0 mm/memory.c:4465 > > > do_user_addr_fault+0x598/0xbf0 arch/x86/mm/fault.c:1294 > > > handle_page_fault arch/x86/mm/fault.c:1351 [inline] > > > exc_page_fault+0xab/0x170 arch/x86/mm/fault.c:1404 > > > asm_exc_page_fault+0x1e/0x30 arch/x86/include/asm/idtentry.h:544 > > > RIP: 0010:copy_user_generic_unrolled+0x89/0xc0 arch/x86/lib/copy_us= er_64.S:91 > > > Code: 38 4c 89 47 20 4c 89 4f 28 4c 89 57 30 4c 89 5f 38 48 8d 76 4= 0 48 8d 7f 40 ff c9 75 b6 89 d1 83 e2 07 c1 e9 03 74 12 4c 8b 06 <4c> 89 = 07 48 8d 76 08 48 8d 7f 08 ff c9 75 ee 21 d2 74 10 89 d1 8a > > > RSP: 0018:ffffc9001095fe48 EFLAGS: 00010202 > > > RAX: 0000000000000001 RBX: 0000000020000080 RCX: 0000000000000001 > > > RDX: 0000000000000000 RSI: ffffc9001095fea8 RDI: 0000000020000080 > > > RBP: ffffc9001095fea8 R08: 0000000400000003 R09: ffffc9001095feaf > > > R10: fffff5200212bfd5 R11: 0000000000000000 R12: 0000000000000008 > > > R13: 0000000020000088 R14: 00007ffffffff000 R15: 0000000000000000 > > > copy_user_generic arch/x86/include/asm/uaccess_64.h:37 [inline] > > > raw_copy_to_user arch/x86/include/asm/uaccess_64.h:74 [inline] > > > _copy_to_user+0x11e/0x160 lib/usercopy.c:30 > > > copy_to_user include/linux/uaccess.h:168 [inline] > > > do_pipe2+0x128/0x1b0 fs/pipe.c:1014 > > > __do_sys_pipe fs/pipe.c:1035 [inline] > > > __se_sys_pipe fs/pipe.c:1033 [inline] > > > __x64_sys_pipe+0x2f/0x40 fs/pipe.c:1033 > > > do_syscall_64+0x60/0xe0 arch/x86/entry/common.c:384 > > > entry_SYSCALL_64_after_hwframe+0x44/0xa9