Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1888004rwi; Thu, 20 Oct 2022 19:21:51 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5vtNhpwpcDeHeuXCT09NG/bqbWTpPizK4w7mRgFKslfMsIvhDK4iURw0Ww+8LSo1wwIhm+ X-Received: by 2002:a05:6402:1686:b0:459:4ddf:8f05 with SMTP id a6-20020a056402168600b004594ddf8f05mr15057414edv.375.1666318911459; Thu, 20 Oct 2022 19:21:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666318911; cv=none; d=google.com; s=arc-20160816; b=npSPj50xNcizhio1XXqqUVmzSgbdwX3/uShNqNC8ZAvn8WVp69ciTN0bBuK7DjQvzq P4mb+so1AGjaQ5l7Cq4T/4svdbYPrf3wtWPQRzPjntP9M14jIBOmWzRrHDAH0g9RnFyP d6IKiXZ4BfHOOeT/Eo3Cx2+MLhRg7sk5BaDL8SriD3+Vmce76SAyPvPTuJ3pXLWtyFAY MbnlhUvvK1G+aQP3g8ZbC2A3AW9dT4khbHFZYc2t/d+21pbfJWIKcHglmF2uG9NcXVmk 4NWG1E+FXv4fyKXh3gc1zwiLkBOwJaBVzUlSiBow3/WiBQegCYr5BvkmLmpwqgNUKWMZ zjiA== 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=ZncWdL3mM95UrAjtlnMYK6cfS00d+HEAMrkP+Zaf3vA=; b=Ba5Dv9LuabTnpQ7M5Zfznq1BWh0qrqQW5v0T0ZiZf76S/eBvNIJWRkijqLryml0yqY cZb2uDF1wbIXUf1WUyzbP9usFN0+3IqdCbv5CpIWwDk12HX8qKXhIUI48k5wdQd4jJoy Ggntv5diMXNYuXmsBgdIyHuy4Qah9jBWS3z3oF819sHFAZg69HQTQBPHftgWNIaGBfBE B0l+RP82UUGw2EWANqQTyr28idtikn6+no+siSkupv0JTQTuxsES73Nb109vPqg4/aXx 9giFw2U2XLsxvsxk9MVG7VThZv6dFKYwfsXGhHQrStuWjaYsBk+ExYknxVbHXXxkc1tU t8FA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=ETCDQ1V0; 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 jg16-20020a170907971000b00782686da1d1si17337873ejc.761.2022.10.20.19.21.19; Thu, 20 Oct 2022 19:21:51 -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=ETCDQ1V0; 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 S229909AbiJUB67 (ORCPT + 99 others); Thu, 20 Oct 2022 21:58:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229834AbiJUB64 (ORCPT ); Thu, 20 Oct 2022 21:58:56 -0400 Received: from mail-yb1-xb2f.google.com (mail-yb1-xb2f.google.com [IPv6:2607:f8b0:4864:20::b2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CB12158D61 for ; Thu, 20 Oct 2022 18:58:55 -0700 (PDT) Received: by mail-yb1-xb2f.google.com with SMTP id y72so1657241yby.13 for ; Thu, 20 Oct 2022 18:58:55 -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:subject:date:message-id:reply-to; bh=ZncWdL3mM95UrAjtlnMYK6cfS00d+HEAMrkP+Zaf3vA=; b=ETCDQ1V0Rav1JUKf7JrFXd/bCduUcFQSGNKFTEgHoxSvIBzuBRYzSFf5jfF8MfgzNS 655pcJShWcEHHLby6HitiQxsf2tdeTpbHml6ZpXhrXN0hec/Tq6PbCOMdN2WUdVGrp99 I/oMpE8qoZwo+YYe6hG9kY2kjw1eo0qnDlEBHd2kfm7+T71jN4FH0P+AxEt2ZJ2Yz2Ne U1iEAgwV2/K0iBNG0n6pgDll8zJMPZEGjUXkDJM2B78l3mR9XaKGv+cXh9jXerF2Ed+n LN+BMVqANeeZ++6dvFeFgZ4bI511bPfP45wQko6FQgvJRz7QeGzO9IEWDVQ+QXQAYNYU O1Eg== 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:subject:date:message-id :reply-to; bh=ZncWdL3mM95UrAjtlnMYK6cfS00d+HEAMrkP+Zaf3vA=; b=rIv0b3rqNCDzaEci5Des63bJShCKQfEA3tAl0P673NZKuXBOgRMJ0eg60mjpm9A2Y1 W4cCKFE4u/HfhEiBD2tAlasPuNyaNcZlHK20MHedBFLOOcL35M3aGF7B/u9FEWsU3Ymh 2OMesGxpTdg4SpAtlZzK8FApeOV+U4lXqR0JLkElw12Q86YEwiKm7o6kKQKCplg21jm1 1tSAZf/tFzr1yvyAqTrW1ommSijLzF0MH0eNtjF57Ccf2BvYSA/qD6e2syMyyJKokgXB YXvilZHVM1rQWY5HvvmMvpOjhZxJFo6/jsTaWGcx/X26UmD3ClaaEVg4an7Qw+bXveVW ZcZw== X-Gm-Message-State: ACrzQf16B4Dqkme2BaP16HxNUBgs9gV5hdHIlTI5XXKGa6fPTXH3flAf RFJu2IzrJvs/Xdyq5DiqEPwG3xXvdTFMxeiaQ2JDSw== X-Received: by 2002:a05:6902:1244:b0:6bd:6409:9591 with SMTP id t4-20020a056902124400b006bd64099591mr14512504ybu.431.1666317534121; Thu, 20 Oct 2022 18:58:54 -0700 (PDT) MIME-Version: 1.0 References: <0000000000009fa63105eb7648d8@google.com> <00000000000031aec805eb76a2d4@google.com> <20221020182155.ecd44ee984b1aeb2e5a2e8ed@linux-foundation.org> In-Reply-To: <20221020182155.ecd44ee984b1aeb2e5a2e8ed@linux-foundation.org> From: Suren Baghdasaryan Date: Thu, 20 Oct 2022 18:58:42 -0700 Message-ID: Subject: Re: [syzbot] BUG: sleeping function called from invalid context in vm_area_dup To: Andrew Morton Cc: syzbot , bigeasy@linutronix.de, bpf@vger.kernel.org, brauner@kernel.org, ebiederm@xmission.com, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com, tglx@linutronix.de, linux-mm@kvack.org, David Hildenbrand 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, URIBL_BLOCKED,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable 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 Thu, Oct 20, 2022 at 6:22 PM Andrew Morton wrote: > > On Thu, 20 Oct 2022 05:40:43 -0700 syzbot wrote: > > > syzbot has found a reproducer for the following issue on: > > Thanks. > > > > HEAD commit: acee3e83b493 Add linux-next specific files for 20221020 > > git tree: linux-next > > console+strace: https://syzkaller.appspot.com/x/log.txt?x=170a8016880000 > > kernel config: https://syzkaller.appspot.com/x/.config?x=c82245cfb913f766 > > dashboard link: https://syzkaller.appspot.com/bug?extid=b910411d3d253dab25d8 > > compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 > > syz repro: https://syzkaller.appspot.com/x/repro.syz?x=109e0372880000 > > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1770d752880000 > > > > Downloadable assets: > > disk image: https://storage.googleapis.com/syzbot-assets/98cc5896cded/disk-acee3e83.raw.xz > > vmlinux: https://storage.googleapis.com/syzbot-assets/b3d3eb3aa10a/vmlinux-acee3e83.xz > > > > IMPORTANT: if you fix the issue, please add the following tag to the commit: > > Reported-by: syzbot+b910411d3d253dab25d8@syzkaller.appspotmail.com > > > > BUG: sleeping function called from invalid context at include/linux/sched/mm.h:274 > > This is happening under dup_anon_vma_name(). > > I can't spot preemption being disabled on that call path, and I assume > this code has been exercised for some time. Indeed, it is unclear why copy_vma() would be called in atomic context. I'll try to reproduce tomorrow. Maybe with lockdep enabled we can get something interesting. > > I wonder if this could be fallout from the KSM locking error which > https://lkml.kernel.org/r/8c86678a-3bfb-3854-b1a9-ae5969e730b8@redhat.com > addresses. Seems quite unlikely. > > > in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 3602, name: syz-executor107 > > preempt_count: 1, expected: 0 > > RCU nest depth: 0, expected: 0 > > INFO: lockdep is turned off. > > Preemption disabled at: > > [<0000000000000000>] 0x0 > > CPU: 0 PID: 3602 Comm: syz-executor107 Not tainted 6.1.0-rc1-next-20221020-syzkaller #0 > > Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/2022 > > Call Trace: > > > > __dump_stack lib/dump_stack.c:88 [inline] > > dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 > > __might_resched.cold+0x222/0x26b kernel/sched/core.c:9890 > > might_alloc include/linux/sched/mm.h:274 [inline] > > slab_pre_alloc_hook mm/slab.h:727 [inline] > > slab_alloc_node mm/slub.c:3323 [inline] > > slab_alloc mm/slub.c:3411 [inline] > > __kmem_cache_alloc_lru mm/slub.c:3418 [inline] > > kmem_cache_alloc+0x2e6/0x3c0 mm/slub.c:3427 > > vm_area_dup+0x81/0x380 kernel/fork.c:466 > > copy_vma+0x376/0x8d0 mm/mmap.c:3216 > > move_vma+0x449/0xf60 mm/mremap.c:626 > > __do_sys_mremap+0x487/0x16b0 mm/mremap.c:1075 > > do_syscall_x64 arch/x86/entry/common.c:50 [inline] > > do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 > > entry_SYSCALL_64_after_hwframe+0x63/0xcd > > RIP: 0033:0x7fd090fa5b29 > > Code: 28 c3 e8 2a 14 00 00 66 2e 0f 1f 84 00 00 00 00 00 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 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48 > > RSP: 002b:00007ffc2e90bd38 EFLAGS: 00000246 ORIG_RAX: 0000000000000019 > > RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fd090fa5b29 > > RDX: 0000000000001000 RSI: 0000000000004000 RDI: 00000000201c4000 > > RBP: 00007fd090f69cd0 R08: 00000000202ef000 R09: 0000000000000000 > > R10: 0000000000000003 R11: 0000000000000246 R12: 00007fd090f69d60 > > R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 > >