Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp267790iob; Thu, 28 Apr 2022 01:47:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyShN2P+284FQRWJ5jBSRHU/D4iZnlb4GGJimbvI8UVOyiqgDEHMwrdRKmyzmL23DkG/kLL X-Received: by 2002:a17:907:1614:b0:6f3:e8a3:9fe1 with SMTP id hb20-20020a170907161400b006f3e8a39fe1mr628174ejc.330.1651135650191; Thu, 28 Apr 2022 01:47:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651135649; cv=none; d=google.com; s=arc-20160816; b=LmG23kqikFqgL/MdUssHQgYLV49VMaew7b0wykmo7uvc17TTKuUexxSGWBr16sDgyd E+RNrd1ObXLwgCeQBIxOw86ZufBEx5D449dop4NPL8ZdiAq1FTuFfoTGESRVy5jaGgVs VPJ8DHqbEPK8luZ66gcLUuJ7Jxp+kL91oxHPZ7oKCsoSKkASOeGAg1lVD4SE+R/cq/Il vY3To4RrDvomo7Ndczz+bVBDLFxwmUEz4HTmRsxVmNPclZ61AeUn9uM8i41Gju/7431x 4Sg0JnkeMDqcnuqDeEZeHGQ1hYkK1ZeQcUmWIs/zEmbImEGR/DHxEJfmLlMET2i/tNaj l2yw== 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=XZ0kXxBSl23w8GkxJCbpihVcMvIBI0EhKBEVZyl19iU=; b=BTY/wCR00lV7DClR5sYTFAFaKgExeXzVxqTyycqV6KKYxLcGZkVDAsZn/doWg6bb7i FPWDk8NnpAYXQgWRk6K96XgosNRiejkiVCldyHX2o7LC5IklInPmKX9uFck0G9axcYS7 a4liWypmjbUKa7VpSo9X2xBn7bCzFj3uNjkhX8rTL3iO0WEDgWg0X3Hck0X+azzm271c EdvG0P7V4xZrLjTnDbjlBAjziaAhLNmWqajNmW2DM2EqmA1niAAoxmkzYDzGUOKYei/i 4Ku4s9ved5h5oxecXvbT1SLUNnKvPG4NjV3RdHoxzLU8VcWeFpYCFpnDjN+60qLbECwG oI1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=dvftVoIM; 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 dd17-20020a170906c83100b006f3a202b991si3007683ejb.990.2022.04.28.01.47.06; Thu, 28 Apr 2022 01:47:29 -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=dvftVoIM; 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 S242871AbiD1FQ5 (ORCPT + 99 others); Thu, 28 Apr 2022 01:16:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233104AbiD1FQz (ORCPT ); Thu, 28 Apr 2022 01:16:55 -0400 Received: from mail-oi1-x22f.google.com (mail-oi1-x22f.google.com [IPv6:2607:f8b0:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4A2A7521D for ; Wed, 27 Apr 2022 22:13:37 -0700 (PDT) Received: by mail-oi1-x22f.google.com with SMTP id m11so4241434oib.11 for ; Wed, 27 Apr 2022 22:13:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=XZ0kXxBSl23w8GkxJCbpihVcMvIBI0EhKBEVZyl19iU=; b=dvftVoIMKtGIe2CqgEQVSZkJI1zm+fPAvSgmxv4X4kZ7DVd7W6SrmLMRZkZQ6EwSvV yT22EXrwEA+DNaLxV2s/XJYBoxapr8kqn7UsTVOUUP8tzzoJoatSFEbfC6TlS7rpIrTc OQYmlpnKP7AUCPfB9B7HMIh6hkjBUKWwQ2dT6mwtMroUOz7+A3y9NlYKIg08+X3YWiAO OFK4VhpU0R9IuPAOCncrJS2+H2jtFpxvuxmRkBlS6FrBY+SvHLRUgRS8ZlpKgqnjJv3A Q+ygVBrbRlqRjbg1KUnPDfeCVmeK4MQe6RdrQZi3rQJROVtACYJuzzR/9n8L2Rnsto5Y RjFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=XZ0kXxBSl23w8GkxJCbpihVcMvIBI0EhKBEVZyl19iU=; b=TPhX4RQjvTLepsh3mwruFe0d438t5Tr8Q+qYnCHxbDhQBOTiWG2YU3N81CvtnyY7T7 aRPJU2DcTEaL99vFyFvrx9JycuEM2Zw+4njl/mKzYztMYhMl+CTfoFlBfb2kbn0RCXgG MtOoR6TVEszo0hQdyqV6khpdBd1A47u0UkLUBK84gYlJvGJa23XsM43sAIq3n7R6Zf9q MOorol+sa3j+jA4qSbx7YC266crPAi9JzTBQqozGbTqyRLopq/X11ak+7AKCn17AOoYf jrX9g9FJbgvKlUOeryJ0GTcfdvtIEtrqwjAjX3nhBNIdAVksE0i6xDRfJRnX1TDZ88FQ xDGg== X-Gm-Message-State: AOAM530gyb8AhCSgH5Adv4Thild5sA2oGMjI5qwggvq1P0YfjP3jWZcP 9d1IY9jJ1hcg3+xrdFtPJ9M4gUPgYzi8jIvXYClBnQ== X-Received: by 2002:a05:6808:21a1:b0:322:b5a1:b261 with SMTP id be33-20020a05680821a100b00322b5a1b261mr19509167oib.211.1651122816673; Wed, 27 Apr 2022 22:13:36 -0700 (PDT) MIME-Version: 1.0 References: <000000000000a23c8505dda227eb@google.com> <000000000000f28f0005dda29992@google.com> <20220427102032.5a87283eb64d06c1a6d682fd@linux-foundation.org> <20220427175218.cazytgdlpc6lpn45@revolver> <20220427190622.wgoxjjbmphdo3xxw@revolver> In-Reply-To: <20220427190622.wgoxjjbmphdo3xxw@revolver> From: Dmitry Vyukov Date: Thu, 28 Apr 2022 07:13:25 +0200 Message-ID: Subject: Re: [syzbot] WARNING in vma_merge To: Liam Howlett Cc: Andrew Morton , syzbot , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , "syzkaller-bugs@googlegroups.com" , Peter Xu , Qian Cai 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, 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 Wed, 27 Apr 2022 at 21:06, Liam Howlett wrote: > > * Liam R. Howlett [220427 13:52]: > > * Andrew Morton [220427 13:20]: > > > On Wed, 27 Apr 2022 06:15:20 -0700 syzbot wrote: > > > > > > > syzbot has found a reproducer for the following issue on: > > > > > > Thanks. > > > > > > userfaultfd_release() appears to have offended vma_merge(). > > > > Potentially apply_mlockall_flags() and not userfaultfd_release(). There > > is a potential that the vma iterator is stale if a split/merge succeeds, > > although KASAN should pick this up and KASAN is active according to the > > config below. I've sent a patch for the mlockall issue after Qian Cai's > > reported it to linux-mm. > > > > > > > > I'm not seeing any changes in that area from Peter, but Liam's > > > mapletree work changed things around a bit. Gents, could you please > > > take a look? > > > > > > > > > > HEAD commit: f02ac5c95dfd Add linux-next specific files for 20220427 > > > > git tree: linux-next > > > > console output: https://syzkaller.appspot.com/x/log.txt?x=105a33a2f00000 > > > > kernel config: https://syzkaller.appspot.com/x/.config?x=e9256c70f586da8a > > > > dashboard link: https://syzkaller.appspot.com/bug?extid=7728e4ab5371cebc9c00 > > > > 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=15f76f82f00000 > > > > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=12b42c3cf00000 > > > > > > > > IMPORTANT: if you fix the issue, please add the following tag to the commit: > > > > Reported-by: syzbot+7728e4ab5371cebc9c00@syzkaller.appspotmail.com > > > > > > ... > > > > > I cannot get this issue to trigger with the given tree and git repo with > > my config. I will try again with the kernel config above. > > > I was able to reproduce the issue using the config from syzkaller in my > VM and can confirm it was the apply_mlockall_flags() bug also reported > by Qian Cai [1]. The patch I sent earlier [2] fixes this issue as well. > > > 1. https://lore.kernel.org/linux-mm/20220427161033.GA1935@qian/ > 2. https://lore.kernel.org/linux-mm/20220427165139.5s3qcj2u5vqrvwlc@revolver/ > > Thanks, > Liam Let's tell syzbot about the fix: #syz fix: mm/mlock: use maple state in apply_mlockall_flags()