Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp4664545rwe; Mon, 17 Apr 2023 16:53:37 -0700 (PDT) X-Google-Smtp-Source: AKy350agkzcsAQILgKLpfvgxHJdaKeL6kgL0LZ/ZDvweES2e9Dul3cKsSMKy1j+6bYAye58Edzys X-Received: by 2002:a17:90a:a50a:b0:246:594d:3b05 with SMTP id a10-20020a17090aa50a00b00246594d3b05mr240531pjq.17.1681775617291; Mon, 17 Apr 2023 16:53:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681775617; cv=none; d=google.com; s=arc-20160816; b=Mx+jdMdnAGWuk27Cw9zG5vqujUjYMD1UxnbK5A4u4qcSFkYpfgHag5VfSdcCr3keP0 kMRcfMHEEPDlhBmSzxFMrzXqn61EmpLWusVZbZjU/iiRko1TP6K+qQxVmMJbdzmGXciI 7KnDZncARy9OH2riLFXc54EqvlgPwir1pxmsr5VWfB1XKZfcRL/TffKMgfedfBU9cCt2 kGz8m+59db8jMpWbYj5HPWM7EDzn/8vOXrIo5nehfUA9Rl4kQrit+yoB8pFpf1wFmust TdLNMHZ0Pf95KVTZgBsviwCtt7QUXma5zMYLTcADQrCCwvj/KhcyAZ7InUFgc4jh7xCt krlg== 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=gWMVRrCZP3Qt94ZbvMVGpkAONW+sOkxybxrPxJzo+gg=; b=W3W2Nbr+KjavFbi+CHFF5saO58ALZ6MUA+A/eYljqgrAmUuEeU6qQ/XxBxeUwYyayx rpDy6ObO7uBCiV1wLiI4436iZ3MmW7Hwqnt9Vw9LMVCKwBfHm5M2nQ0uVDRSD3285bNn 6fbJl2ANhzc6t+Svm2T+3OUErnA8OUf4tdfY2LpgbNO9uygivpfiaSWONN65Ng9qQWyG zbmrdM7Du0WxfKUOourJsFk/4ynHT+CMnOsCxN4EB5bQXZuStqLJQvT/iMnO4wuCFoPJ 3O9xQ/A58fEfVQ/diyfjv7rwfMDNrSh2WPoVSbS0iBnJjkF3Uuf1XDLeKdlLlc+tzLB5 wRxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=sVSf3VXB; 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 nl5-20020a17090b384500b0023af4ee47dasi1795370pjb.65.2023.04.17.16.53.25; Mon, 17 Apr 2023 16:53:37 -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=@linux-foundation.org header.s=korg header.b=sVSf3VXB; 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 S230000AbjDQXs0 (ORCPT + 99 others); Mon, 17 Apr 2023 19:48:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229529AbjDQXsZ (ORCPT ); Mon, 17 Apr 2023 19:48:25 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40C67272A; Mon, 17 Apr 2023 16:48:24 -0700 (PDT) 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 CF74D6209F; Mon, 17 Apr 2023 23:48:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D9AD1C433EF; Mon, 17 Apr 2023 23:48:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1681775303; bh=5Zdo30UwbY/ugu5/xvKsTrl3c9ZrDjjdWYxF5rzZT84=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=sVSf3VXBkTRXrirTwU3FG2FBV7kU4yfoxfiWm7KupFJBq0aLURnd6HUp/GZlsbc+3 AFA6HPhkZkm7DvYCkWOct6xO3S1WXD0jZ00eeJ32RV6LKYYYy5sHDNLNFe3wk4yRuR NXNS1wOJHqds6ummn+iJkFYaHoKPuy7smosu3Bic= Date: Mon, 17 Apr 2023 16:48:22 -0700 From: Andrew Morton To: Peter Xu Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Mike Kravetz , Andrea Arcangeli , Mika =?ISO-8859-1?Q?Penttil=E4?= , Axel Rasmussen , Nadav Amit , David Hildenbrand , linux-stable Subject: Re: [PATCH v2 2/6] mm/hugetlb: Fix uffd-wp bit lost when unsharing happens Message-Id: <20230417164822.d1f5d162115c53aab4c85e85@linux-foundation.org> In-Reply-To: <20230417195317.898696-3-peterx@redhat.com> References: <20230417195317.898696-1-peterx@redhat.com> <20230417195317.898696-3-peterx@redhat.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=-9.4 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,T_SCC_BODY_TEXT_LINE 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 Mon, 17 Apr 2023 15:53:13 -0400 Peter Xu wrote: > When we try to unshare a pinned page for a private hugetlb, uffd-wp bit can > get lost during unsharing. Fix it by carrying it over. > > This should be very rare, only if an unsharing happened on a private > hugetlb page with uffd-wp protected (e.g. in a child which shares the same > page with parent with UFFD_FEATURE_EVENT_FORK enabled). What are the user-visible consequences of the bug? > Cc: linux-stable When proposing a backport, it's better to present the patch as a standalone thing, against current -linus. I'll then queue it in mm-hotfixes and shall send it upstream during this -rc cycle. As presented, this patch won't go upstream until after 6.3 is released, and as it comes later in time, more backporting effort might be needed. I can rework things if this fix is reasonably urgent (the "user-visible consequences" info is the guide). If not urgent, we can leave things as they are.