Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp5576790rwb; Tue, 17 Jan 2023 16:01:41 -0800 (PST) X-Google-Smtp-Source: AMrXdXvB9wSXDaLuBYghYbM+f+Yu2Xl+3WtTlkDkr/P7Do6PJXO+ljejx/0VkOLy07Xy5k7vG725 X-Received: by 2002:a17:906:85cf:b0:870:159f:c515 with SMTP id i15-20020a17090685cf00b00870159fc515mr5429229ejy.21.1674000100917; Tue, 17 Jan 2023 16:01:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674000100; cv=none; d=google.com; s=arc-20160816; b=WeVcU0QwrnczbJiULE7m7EJfCmpsWwI2YhfQi4E57RFtHXzBRG9yv8MzIfe023OWw/ GnZbu9Kk+K8Be7SuDO7hNYcrAoIXLcuFYo+BhnoegqpKQmEDGX7nPkirebfgohwUwkwm 1hVsRV0WPV8ygTGCEXzxNNxKTh/JeG/2FluKGWifmPY5WI2ZiB+2CAmf31zEvj243dvy k8K1ChS6/WdTLqua/i4uj42SDlzxrLM+hiz98qyJEqbWIozlQuuhxWDWR5r/78Yb6iyc fTy4r9PhWnjJQQzssSx2h+NK7N5RXIfskg032BeKTQNhheh0rYwr1CFnqUC4XRetJBBi xwyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=KXKRGn/dzqIKdPvAbglAt5R79trwquVA2omEcZPVp2g=; b=ZckeWHdqsZDlNFrkoQqM/sxrOwNfSuX63G2WUCv5cM4KPwEWGi73IEDG+gpkU0m1YG V4Zb/XYuTv8RZ5R7h/mniZmcEjJbNTGy45nh4/nYp4WV53OwmDwPIcQC5pom3rMAU9RH lG4jjI/Un8ia7j4Pof1PaieEVXvLs6z/WROZNBuvawJcNsEnXU45Ggw/eUdLKYkeGx8O x1gcM0CgzZLTZqLgP4c1qOxZAbtLLqcke7H0rmeO/HoTMznK2EkswS5uj2ZQnMFu4sMC i+hTVBfQOPBuHPxxwtr1WuYaz3hdpKGWSplMJ6WGc1VED6odohyaOpWA06Rf/hISoVmc usHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b="y/ZuQQ+p"; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id wu4-20020a170906eec400b008269916aa9dsi35428159ejb.160.2023.01.17.16.01.29; Tue, 17 Jan 2023 16:01:40 -0800 (PST) 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=@linux-foundation.org header.s=korg header.b="y/ZuQQ+p"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229499AbjAQXr4 (ORCPT + 46 others); Tue, 17 Jan 2023 18:47:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229615AbjAQXrU (ORCPT ); Tue, 17 Jan 2023 18:47:20 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5133E4A1C6 for ; Tue, 17 Jan 2023 14:55:34 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E34A661518 for ; Tue, 17 Jan 2023 22:55:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 159F0C433D2; Tue, 17 Jan 2023 22:55:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1673996133; bh=ruz2A/4YTpx7OPy42aBIYAuAK+3AVNnrNmXTqZhAjSw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=y/ZuQQ+p4hfhGFe69OrMaDXIxXOokePloiIt8MOIBxTvN/X+vyXL5rhQec1Pzm04+ gcdtWeEbgYuzL8dWjHGim2Y0ieXi8BTCLiW1odv162eAAjFcLBfLHRL7mXCbQ9w9mF yXOz2S3kJUauib96LWDIOZtj1rULvC2hyVwYNOA4= Date: Tue, 17 Jan 2023 14:55:32 -0800 From: Andrew Morton To: Jann Horn Cc: "Kirill A. Shutemov" , "Zach O'Keefe" , linux-kernel@vger.kernel.org, David Hildenbrand , Yang Shi , linux-mm@kvack.org Subject: Re: [PATCH] mm/khugepaged: Fix ->anon_vma race Message-Id: <20230117145532.94132510f8bc538d5465fd43@linux-foundation.org> In-Reply-To: References: <20230111133351.807024-1-jannh@google.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 Tue, 17 Jan 2023 20:12:49 +0100 Jann Horn wrote: > On Wed, Jan 11, 2023 at 2:33 PM Jann Horn wrote: > > If an ->anon_vma is attached to the VMA, collapse_and_free_pmd() requires > > it to be locked. retract_page_tables() bails out if an ->anon_vma is > > attached, but does this check before holding the mmap lock (as the comment > > above the check explains). > > @akpm please replace the commit message with the following, and maybe > also add a "Link:" entry pointing to > https://lore.kernel.org/linux-mm/CAG48ez3434wZBKFFbdx4M9j6eUwSUVPd4dxhzW_k_POneSDF+A@mail.gmail.com/ > for the reproducer. Done, thanks.