Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1532829rwb; Fri, 12 Aug 2022 02:32:36 -0700 (PDT) X-Google-Smtp-Source: AA6agR6I9ibLIstIh550IFxeJkzsU5HPbHySxj+sgyCk2O4D80e3/vWGjya9QmtJ0fjsnIENYujj X-Received: by 2002:a05:6402:84e:b0:440:4bac:be5a with SMTP id b14-20020a056402084e00b004404bacbe5amr2815807edz.103.1660296755857; Fri, 12 Aug 2022 02:32:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660296755; cv=none; d=google.com; s=arc-20160816; b=H4RUgI5fEuuSFSFpyGxXUFxAz0zN3FJ1E1O+uycnJfH0gc1DOr/n9uBFEq34Q0nwgm kGeP3jci9Jd7p+WEpDM0ubEFxH0Svieqb9yyhBTGNqQtGJ9wUknYL2K1OmYqiaKu7mRk ZEW4+7NtEbqL9YtkAd0cIA3bNoMjPv4PU15kLRhK96+psRQkW7vr+74J+TKD9jShQI/I vXAtv7JnK8iir4N+58LIyyWUPrk0TBwBw0469tJJOeHDAkjh5df278VQxUeZUf7hgLQb dCRQffSbyX+YrY1Q8VnUGwaSQfWS6B+3Bpx3dYV8KgrYXg0cyN2Yy8faXCw8ukfeT9Dd 1VuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=92ou/u14nlAhRLAjyH+K5VTnxlst6DGZsroJdwVOovQ=; b=J4O7FLUp0ZdarneRoHbEYD+PWyIMaeVXoHFLNKgsq5myaUEnBG1m8+fn8HP+mDn+7V 8awN9GKIppzyx7ncAPsN6GYdi11eEtWcdl6KjH4PITWvB7IW/sr5K+Es6Xp8oi45TJ7f wCPX2x0m+3ZS7hW16d8xa7GwN4fggAPSC0m4nYTM6PNlui/6LrofvtDNtTtQ+MoHxgWl yrHSVp78Xy8D7u337t3J+UAXG9rGtVq8mgUTc/W5GM2tTW/l8MRGBKsduGvrOU74ofB1 i3EKpALRRLIZcSuabqAeHY1ew67TzzF31hGtWp75Hf+VA/GxpaCKEN0eD7SZjawJxI2J AxTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=BYUOxr06; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ga13-20020a1709070c0d00b006ff49b183e9si1516776ejc.971.2022.08.12.02.32.10; Fri, 12 Aug 2022 02:32:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=BYUOxr06; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237948AbiHLJaA (ORCPT + 99 others); Fri, 12 Aug 2022 05:30:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236848AbiHLJ37 (ORCPT ); Fri, 12 Aug 2022 05:29:59 -0400 Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3ABF3A598A for ; Fri, 12 Aug 2022 02:29:58 -0700 (PDT) Received: by mail-lj1-x22e.google.com with SMTP id bx38so383961ljb.10 for ; Fri, 12 Aug 2022 02:29:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=92ou/u14nlAhRLAjyH+K5VTnxlst6DGZsroJdwVOovQ=; b=BYUOxr06BCh8L+j+0kdrblTLsfOAc/S1qPRVrIOUjSIteDptTVgc3VdOuPlNx8LkCE 7HL2VOP0xS7+FoFkFpGkV/2J62IDmuPMsY3+3zCsuSBJ/or6VNQAAOTVXj3RMINn3H7L VL2qIe3Z2mCX6vXter3C+GKO0XkjbhdppPRoRdPMKvVHG0EFp1ff508s8QqKCEQ8960l FGCxlwJNlnJRYyrpBQZdIr55z5UyDM3M/yL4Rfxr8HH5vIuvKOUaNXEcZ7cFA9GvA4wj egjarR98yKRN6RZPLnyEmnljddhDPuWpMH5ffg9hGkG034uwDBRtap6niExmB3h+RrUj VAbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=92ou/u14nlAhRLAjyH+K5VTnxlst6DGZsroJdwVOovQ=; b=BeAe6yqzwNDlzEQunuDMJfnUGzt1HMD8qAUsa+iCbaFmltZaBaD9OQamgNa55dta8v pgU6k8NJFMeAeVn72l4TtHiEPweyzxbaCVIUSBa4OKKD6PgQcDuma4Lm7V2T3t6D5c8+ 3HdNUnF+hxx9qqGdIKn7LBSiU1rdEhlfVk1FxiLp5Zh+2++1QrYUYHPBl9Cb2/54zOHQ nCvFd4FI2oWUa5mDZCQKHYArNQg66IL9YrYVi8Viwdwnby68Kt64GvVqbw+d0vlO6kVr NNXaZnTnI9BtMBIt5swHto3O3UPhAYeA53J1A5Aa0cAU/R32fQJ9wCt1g4lGsAIBldRQ J6tQ== X-Gm-Message-State: ACgBeo1MLg/w7iDwM3FgXeF0juzOg4CJjUoYbLnVxCaPmiJ8r2YzrJ2a iKiwgzofKRCgVavHuaMlacHJmF+qvp7tMFEUJPccww== X-Received: by 2002:a2e:a5ca:0:b0:25e:1c49:70f4 with SMTP id n10-20020a2ea5ca000000b0025e1c4970f4mr988263ljp.4.1660296596373; Fri, 12 Aug 2022 02:29:56 -0700 (PDT) MIME-Version: 1.0 References: <0000000000008c0ba505e5f22066@google.com> <202208110830.8F528D6737@keescook> <202208111356.97951D32@keescook> In-Reply-To: From: Dmitry Vyukov Date: Fri, 12 Aug 2022 11:29:44 +0200 Message-ID: Subject: Re: [syzbot] linux-next boot error: BUG: unable to handle kernel paging request in kernel_execve To: Ira Weiny Cc: Kees Cook , "Fabio M. De Francesco" , ebiederm@xmission.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-next@vger.kernel.org, sfr@canb.auug.org.au, syzkaller-bugs@googlegroups.com, viro@zeniv.linux.org.uk, syzbot Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 12 Aug 2022 at 02:11, Ira Weiny wrote: > > On Thu, Aug 11, 2022 at 02:00:59PM -0700, Kees Cook wrote: > > On Thu, Aug 11, 2022 at 11:51:34AM -0700, Ira Weiny wrote: > > > On Thu, Aug 11, 2022 at 10:39:29AM -0700, Ira wrote: > > > > On Thu, Aug 11, 2022 at 08:33:16AM -0700, Kees Cook wrote: > > > > > Hi Fabio, > > > > > > > > > > It seems likely that the kmap change[1] might be causing this crash. Is > > > > > there a boot-time setup race between kmap being available and early umh > > > > > usage? > > > > > > > > I don't see how this is a setup problem with the config reported here. > > > > > > > > CONFIG_64BIT=y > > > > > > > > ...and HIGHMEM is not set. > > > > ...and PREEMPT_RT is not set. > > > > > > > > So the kmap_local_page() call in that stack should be a page_address() only. > > > > > > > > I think the issue must be some sort of race which was being prevented because > > > > of the preemption and/or pagefault disable built into kmap_atomic(). > > > > > > > > Is this reproducable? > > > > > > > > The hunk below will surely fix it but I think the pagefault_disable() is > > > > the only thing that is required. It would be nice to test it. > > > > > > Fabio and I discussed this. And he also mentioned that pagefault_disable() is > > > all that is required. > > > > Okay, sounds good. > > > > > Do we have a way to test this? > > > > It doesn't look like syzbot has a reproducer yet, so its patch testing > > system[1] will not work. But if you can send me a patch, I could land it > > in -next and we could see if the reproduction frequency drops to zero. > > (Looking at the dashboard, it's seen 2 crashes, most recently 8 hours > > ago.) > > Patch sent. > > https://lore.kernel.org/lkml/20220812000919.408614-1-ira.weiny@intel.com/ > > But I'm more confused after looking at this again. There is splat of random crashes in linux-next happened at the same time: https://groups.google.com/g/syzkaller-bugs/search?q=%22linux-next%20boot%20error%3A%22 There are 10 different crashes in completely random places. I would assume they have the same root cause, some silent memory corruption or something similar. > > [1] https://github.com/google/syzkaller/blob/master/docs/syzbot.md#testing-patches > > > > > > > > syzbot found the following issue on: > > > > > > > > > > > > HEAD commit: bc6c6584ffb2 Add linux-next specific files for 20220810 > > > > > > git tree: linux-next > > > > > > console output: https://syzkaller.appspot.com/x/log.txt?x=115034c3080000 > > > > > > kernel config: https://syzkaller.appspot.com/x/.config?x=5784be4315a4403b > > > > > > dashboard link: https://syzkaller.appspot.com/bug?extid=3250d9c8925ef29e975f > > > > > > compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 > > > > > > > > > > > > IMPORTANT: if you fix the issue, please add the following tag to the commit: > > > > > > Reported-by: syzbot+3250d9c8925ef29e975f@syzkaller.appspotmail.com > > > > > > > > > > > > BUG: unable to handle page fault for address: ffffdc0000000000 > > > > > > #PF: supervisor read access in kernel mode > > > > > > #PF: error_code(0x0000) - not-present page > > > > > > PGD 11826067 P4D 11826067 PUD 0 > > > > > > Oops: 0000 [#1] PREEMPT SMP KASAN > > > > > > CPU: 0 PID: 1100 Comm: kworker/u4:5 Not tainted 5.19.0-next-20220810-syzkaller #0 > > > > > > Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/22/2022 > > > > > > RIP: 0010:strnlen+0x3b/0x70 lib/string.c:504 > > > > > > Code: 74 3c 48 bb 00 00 00 00 00 fc ff df 49 89 fc 48 89 f8 eb 09 48 83 c0 01 48 39 e8 74 1e 48 89 c2 48 89 c1 48 c1 ea 03 83 e1 07 <0f> b6 14 1a 38 ca 7f 04 84 d2 75 11 80 38 00 75 d9 4c 29 e0 48 83 > > > > > > RSP: 0000:ffffc90005c5fe10 EFLAGS: 00010246 > > > > > > RAX: ffff000000000000 RBX: dffffc0000000000 RCX: 0000000000000000 > > > > > > RDX: 1fffe00000000000 RSI: 0000000000020000 RDI: ffff000000000000 > > > > > > RBP: ffff000000020000 R08: 0000000000000005 R09: 0000000000000000 > > > > > > R10: 0000000000000006 R11: 0000000000000000 R12: ffff000000000000 > > > > > > R13: ffff88814764cc00 R14: ffff000000000000 R15: ffff88814764cc00 > > > > > > FS: 0000000000000000(0000) GS:ffff8880b9a00000(0000) knlGS:0000000000000000 > > > > > > CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > > > > > > CR2: ffffdc0000000000 CR3: 000000000bc8e000 CR4: 00000000003506f0 > > > > > > DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 > > > > > > DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 > > > > > > Call Trace: > > > > > > > > > > > > strnlen include/linux/fortify-string.h:119 [inline] > > > > > > copy_string_kernel+0x26/0x250 fs/exec.c:616 > > > > > > copy_strings_kernel+0xb3/0x190 fs/exec.c:655 > > > > > > kernel_execve+0x377/0x500 fs/exec.c:1998 > > > > > > call_usermodehelper_exec_async+0x2e3/0x580 kernel/umh.c:112 > > > > > > ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 > > > > > > > > > [...] > > > > > > --- > > > > > > 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. > > > > -- > > Kees Cook > > -- > 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/YvWaqhLGsBp9ynIq%40iweiny-desk3.