From patchwork Thu Mar 3 01:38:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugh Dickins X-Patchwork-Id: 12766945 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 24AA4C433EF for ; Thu, 3 Mar 2022 01:38:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AF3158D0002; Wed, 2 Mar 2022 20:38:09 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id AA28A8D0001; Wed, 2 Mar 2022 20:38:09 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 96C238D0002; Wed, 2 Mar 2022 20:38:09 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0201.hostedemail.com [216.40.44.201]) by kanga.kvack.org (Postfix) with ESMTP id 89ABE8D0001 for ; Wed, 2 Mar 2022 20:38:09 -0500 (EST) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 4437A182009FB for ; Thu, 3 Mar 2022 01:38:09 +0000 (UTC) X-FDA: 79201364298.27.21E8754 Received: from mail-oi1-f179.google.com (mail-oi1-f179.google.com [209.85.167.179]) by imf21.hostedemail.com (Postfix) with ESMTP id 986AF1C0002 for ; Thu, 3 Mar 2022 01:38:08 +0000 (UTC) Received: by mail-oi1-f179.google.com with SMTP id j2so3485869oie.7 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=cko7HfHTxUqpPogl2O3csLygSm3treX85/6y/qPG9+wbKea+XiCqK1HkotjnbKZX0g I+eVeux32/ay7W4SWAjUY+Q81p8znJmvcyCBLfNZtOH4Yhh8fwMp/Hd/93pZdKvSpV3k WHr/Eu02RTu5srr1cm1rlMMiT2jEAHWDUWDiVavhQRnuXDR9NYiW6k8ZFwjzHEZ0FR2L jMcTrYIb1caVTCRzMoQtLzUYUp2u3RNjGXQL+jzI230FFCQQeo4uKfji6kHhnD5yzzWb OdxCaeYWfWoV3fUvRaDPAqEbnX7/a3W64YZF3ltp8bj0oKt3oEmPrJ64U06cdK6Z0l7c FpxA== X-Gm-Message-State: AOAM531tQrCCqsmcvgJfgJQWMGjvDKT64S3KJbaf43GT+u33IKJb87fV 94lKV/0KS0gFYEKFJRS0OtwQAA== X-Google-Smtp-Source: ABdhPJwHctsCmBMX1tLO6LBR0LlQfUanQU20847/+pc3K6EFzauBbqBCn/YaS/vohELLSsPtTC9IUA== 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 X-Rspamd-Queue-Id: 986AF1C0002 X-Stat-Signature: g5fxoukwuma38kgca9uqbuyuk1qicpwf Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=dmQCaMCT; spf=pass (imf21.hostedemail.com: domain of hughd@google.com designates 209.85.167.179 as permitted sender) smtp.mailfrom=hughd@google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1646271488-252080 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: _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;