Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp371891pxm; Wed, 2 Mar 2022 17:38:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJykF/IsXLEJo5VCfZ8S0+gKur2CnAZXqhzNRQeM5U8zk/7yr1v3E8z1SNSq5ebGlHqQT6O2 X-Received: by 2002:a63:698a:0:b0:36c:1d0a:2808 with SMTP id e132-20020a63698a000000b0036c1d0a2808mr28090581pgc.567.1646271493235; Wed, 02 Mar 2022 17:38:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646271493; cv=none; d=google.com; s=arc-20160816; b=NNAS7sriH0ydXsMDH2Y+e29uxRKGCtuhZbRkjkJkvNBHQHqZ1DYeT3hBURqyycWTFx afS6DtHLkkTxs4W5uIgJAjPO8O1/3UoLAS4oY4Fl0j6TNZVwo7aaVl/ZlPk+CukfiWdo K+ItZdl7CQ912E1P/uE6gNQIzziI/CGMYZ/VRpPY+qGqhJTYi7/MMD5ykFlylpc7Bh29 CK0EahZrfNqSyCq2p+HBtlg14UFzQHKcjNwLjyW5rER1dljPtapKk868c4u7HJqJYrjr EJaYMfwnnk2fQVTO5fjjI3unYikfAnDonkeJqld7uWIkJfV0A4Ra/v9ONtCt+hwUniu8 9BOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:subject:cc:to:from:date :dkim-signature; bh=DbiPq8ZLkGlerWGYBOSuQst5nwpKXHlgov1TDG2JIo8=; b=cEgmbKeVQ0hNDyZRkCieXbTF2G14z9w5pAgFycfnw66qiQ/d+GBFV1AJX+Wo3EZGQ9 EibVGdpAQyhTA66uqP2sM2N4YzMmazV7gZAYXlq8fDJkeF8Z05lOme2LG2D8+2mB443t 9sIXaC9kqn7JQW6j09wn14WoRgxpHHn1idf63WhgGAwKK9bP/BS/Js5KEi0HgGsUOqto nUi3tf78c7efeKK5f3voyoxrVTEfp4+7v2frvC27c3gKwjWnLKHnZNIwJKLmbJWMBipQ +Y3IAY3elayMyhMnXpHK+7vFnY/+0fi7e2Po4zP16uAR0y2qs0BSxkZhtf793fLI6WqL x7aQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=dmQCaMCT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id f22-20020a056a0022d600b004bf2e472b61si784496pfj.13.2022.03.02.17.38.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 17:38:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=dmQCaMCT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CAE9CBC24; Wed, 2 Mar 2022 17:38:10 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231431AbiCCBix (ORCPT + 99 others); Wed, 2 Mar 2022 20:38:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231363AbiCCBiw (ORCPT ); Wed, 2 Mar 2022 20:38:52 -0500 Received: from mail-oi1-x232.google.com (mail-oi1-x232.google.com [IPv6:2607:f8b0:4864:20::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99BB24BFD9 for ; Wed, 2 Mar 2022 17:38:08 -0800 (PST) Received: by mail-oi1-x232.google.com with SMTP id y7so3478540oih.5 for ; Wed, 02 Mar 2022 17:38:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:mime-version; bh=DbiPq8ZLkGlerWGYBOSuQst5nwpKXHlgov1TDG2JIo8=; b=dmQCaMCThZnF9rFjvRp439A4ZfsAXEDnPRR6S6trppe8EOffC7OqfLXdmu+Z1R1VPa 0twTqz8/Hxy4ZEMJOP6Y/F9dIjhC+vrPnViWVPbBGyN/DHGog1csi8qEqKcL2OE+x9FP tujnQoKwZqEpR+Mh3QvVvLFiJBJzIGGFuZh9zb7ntRUur13jfQiygkwHpqWuVPPBlgGz KHOvzCVB10CBLXvjp9X01fg6gx/Vpm/yAxpXUr7V/SdTeA/NrwfQyy5NhdxOxaWMQdCp PbB5fentoNuMRNoNVcpW+zUScUBYne4vPyqXgX67YzQ8niOGD0JSHeBWKqHlesJVHos9 Qpog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version; bh=DbiPq8ZLkGlerWGYBOSuQst5nwpKXHlgov1TDG2JIo8=; b=Fu6DE5c++Fxwi9KCPLWcH4rg1BzTp362ZZCfSlI4OLSDD+cXR0i4X0S6NXIBlHF6/1 v6ekeK3EFgxYF2pJzo/+NMAvzBcY+p8odRKKXfKvvupbTBRNjYi189rcnhwjPH0Lu9Cq eJgwG4faDDBOLyRhU3gbEES+WZqtYVOBcMRvnC97OhE5PcO4U3z/G8zuIng9cyZJNnfm Hv8Nyx+PNccWPPHPQnD76b2vtlMMxZsBH0ORa+KFOWAyyM9cdimyvhEcRrcxfWT7J1jM oIqIcRlxBAMyvW9fMNe24hdJ+fiEGRQIu5B0kGOrue/eocvoPRV3il+uj05MSfABSwE0 X9mw== X-Gm-Message-State: AOAM53274YKYEk28Z3yGRQXJppL++bS8KUPnC28JJw8nFzeIRsIRD1cf I1qS2xyyIap+xJKwzvMRbq1Zqg== X-Received: by 2002:a05:6808:1646:b0:2d4:428c:659e with SMTP id az6-20020a056808164600b002d4428c659emr2589390oib.20.1646271487661; Wed, 02 Mar 2022 17:38:07 -0800 (PST) Received: from ripple.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id w1-20020a056871060100b000d9a1c283e8sm404851oan.37.2022.03.02.17.38.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 17:38:06 -0800 (PST) Date: Wed, 2 Mar 2022 17:38:05 -0800 (PST) From: Hugh Dickins X-X-Sender: hugh@ripple.anvils To: Andrew Morton cc: Vlastimil Babka , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH mmotm] mm: _install_special_mapping() apply VM_LOCKED_CLEAR_MASK Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_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 _install_special_mapping() adds the VM_SPECIAL bit VM_DONTEXPAND (and never attempts to update locked_vm), so it ought to be consistent with mmap_region() and mlock_fixup(), making sure not to add VM_LOCKED or VM_LOCKONFAULT. I doubt that this fixes any problem in practice: just do it for consistency. Signed-off-by: Hugh Dickins --- Noticed in doing mm/munlock series, but not needed as a part of that. mm/mmap.c | 1 + 1 file changed, 1 insertion(+) --- a/mm/mmap.c +++ b/mm/mmap.c @@ -3420,6 +3420,7 @@ static struct vm_area_struct *__install_special_mapping( vma->vm_end = addr + len; vma->vm_flags = vm_flags | mm->def_flags | VM_DONTEXPAND | VM_SOFTDIRTY; + vma->vm_flags &= VM_LOCKED_CLEAR_MASK; vma->vm_page_prot = vm_get_page_prot(vma->vm_flags); vma->vm_ops = ops;