Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp4011773rdg; Wed, 18 Oct 2023 12:08:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEQtUdphXejTNADTcRQQyAppxnbMDA2PHmoGFMSXeC1a+H1+sg7yK9Ct7AsJiskSL2R+Zwa X-Received: by 2002:a05:6358:24a2:b0:168:9d60:e6b4 with SMTP id m34-20020a05635824a200b001689d60e6b4mr1121683rwc.16.1697656108413; Wed, 18 Oct 2023 12:08:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697656108; cv=none; d=google.com; s=arc-20160816; b=ZI3AFTaoaJTW3QwGg3K6+YnP6PJzX+2Tp+L+qw8cUEQx1vXvs7GDa+twYojM69Gg/T yEX1H5i7iSJDfH0hTqa3D5o07oLHzKmtcyAOQK/fwN/gQv9QHhPhdM2hioTlMoh921kN CK7XcB8BFRKT9EKhviX7u/Fx4iXP7S6abXBsTQUxtaAha73wzZP4mPogbTm9WJydOFp/ lE2zNma526kv4Y5V7VW3E41bs0wBBI3XrOzKk9u+IwLhvzk04Pm8kIZ4wTWn5dM9IO/P TqRLSpYi0Uu/yjtsdnAAHeARhZZQ8NWW6JfIqjeFzgK2uet3az0mrx3lgJsvWFLpY7KY Iosw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=7jLh+LVsADEpQn0tXrIhHZOOTufYjaEXj860xp7E8aI=; fh=A5tR/fPg4W5/UY+St1h4u8Kg+luuf+U9l8bopJi0YzI=; b=xETroT44wjt4ithTDTkuPlnxSbDAu5cCUQomIVzal6gSlMert0eGH6eUSfOUd8lX24 SxTyhVJa6gOLvKCCSX9HPH1H6yBt034mQFbLzoa+fPITWQOZS+ogv9kMVxYKnsg84dEy 397Py6HQAdJC00BgnZ4RPvHDmkIBnz3pTVw5ib7HVBqm3FyNJ3UW+dfYm0mWnGR/Ajv4 BCEw7NrLq7XzlcgpoFxQM5vYZEH5kV3xQFsGCDr6r4nS6+008rSCDXZdLB8WGGCpCJpq On2T6sKuDCaB5GtmKTp0o9gUuSpcPNdm6eMfnIkRYEl72O0XTDKYYcRX2yj/biJWyS6T 7FZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=OBX3H2C7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id s38-20020a056a0017a600b0068e4c3f3ac2si4734235pfg.245.2023.10.18.12.08.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 12:08:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=OBX3H2C7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 02BE080C840C; Wed, 18 Oct 2023 12:08:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230489AbjJRTHv (ORCPT + 99 others); Wed, 18 Oct 2023 15:07:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231244AbjJRTHu (ORCPT ); Wed, 18 Oct 2023 15:07:50 -0400 Received: from mail-qt1-x835.google.com (mail-qt1-x835.google.com [IPv6:2607:f8b0:4864:20::835]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F1BB11F for ; Wed, 18 Oct 2023 12:07:47 -0700 (PDT) Received: by mail-qt1-x835.google.com with SMTP id d75a77b69052e-419b53acc11so57921cf.0 for ; Wed, 18 Oct 2023 12:07:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1697656066; x=1698260866; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=7jLh+LVsADEpQn0tXrIhHZOOTufYjaEXj860xp7E8aI=; b=OBX3H2C7k1EqfyqW6yvKPa2SMVSMKpojBHDSs9X6IFDbHhwz7rEZ+vLnjVJ/u8WUFd USUIZ0xyxBU3qjJ6pmlJyd9GVnOJToHmFvaMQlK/RWfn04ck6DIFiIxjvjhmdg25H41w PpY+uW4qizmSEiX6HVtaL5XEId/RlnSf4VLw+PS1qHJ3jYmz7sK8UaZNQyGyJGENNGBj 5ca6Rz+UxDfZGbB64SG1Kd8kZpiPHL9hYyXhScTe6ncOdDxAkVat0E8SPmlXG9DXbweT uoSedXxbrvJhfTOqO/5tu3veC0Vj3F/G82CN3wd0C49rPMbwBcsVamx6jUWaFo5CokOh hvwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697656066; x=1698260866; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7jLh+LVsADEpQn0tXrIhHZOOTufYjaEXj860xp7E8aI=; b=ZeXpR2TWlCvH/oa0Vwf35tjcxD+0VfJGt4G0feyGH6+BwWSKqKiKA292c85x3wfcJf tkw0lYgxqOskG5GDLdaWmx264teFiBdv2N6iY7kZehEWhW4jkC+bzN0yqW0TxqfzoaYd n0YSg1eIWYYf0SMXdaqTmQoH+ndvOoeO0/HesfIl/Y+G6f2VbURFua9x9PpFt89f9QkM 1vbAoCYcUx6T0WnUxYiQ097zonuQCnopozvy+UCNEsObnYhWAMI3SVmGbIZJUuG6+e5P U+3Watm/217vP+UHdB0Jk2VKiWaK34L6UJoahKQtWlKlJ15nYWVjj5KLzWcozfOXLJn7 JnIQ== X-Gm-Message-State: AOJu0YyybYdbNwSBBqfoIQheM42faLP07exyAvGczki2G/4eRbootDiD SKIDo+fH8kdYwDglCppHvFC4I9Rb6ZMRKimZmuTf6w== X-Received: by 2002:ac8:4d5d:0:b0:41c:b700:fb84 with SMTP id x29-20020ac84d5d000000b0041cb700fb84mr57193qtv.2.1697656066547; Wed, 18 Oct 2023 12:07:46 -0700 (PDT) MIME-Version: 1.0 References: <20231017090815.1067790-1-jeffxu@chromium.org> <20231017090815.1067790-6-jeffxu@chromium.org> In-Reply-To: From: Jeff Xu Date: Wed, 18 Oct 2023 12:07:10 -0700 Message-ID: Subject: Re: [RFC PATCH v2 5/8] mseal: Check seal flag for munmap(2) To: Linus Torvalds Cc: jeffxu@chromium.org, akpm@linux-foundation.org, keescook@chromium.org, jannh@google.com, sroettger@google.com, willy@infradead.org, gregkh@linuxfoundation.org, jorgelo@chromium.org, groeck@chromium.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org, surenb@google.com, alex.sierra@amd.com, apopple@nvidia.com, aneesh.kumar@linux.ibm.com, axelrasmussen@google.com, ben@decadent.org.uk, catalin.marinas@arm.com, david@redhat.com, dwmw@amazon.co.uk, ying.huang@intel.com, hughd@google.com, joey.gouly@arm.com, corbet@lwn.net, wangkefeng.wang@huawei.com, Liam.Howlett@oracle.com, lstoakes@gmail.com, mawupeng1@huawei.com, linmiaohe@huawei.com, namit@vmware.com, peterx@redhat.com, peterz@infradead.org, ryan.roberts@arm.com, shr@devkernel.io, vbabka@suse.cz, xiujianfeng@huawei.com, yu.ma@intel.com, zhangpeng362@huawei.com, dave.hansen@intel.com, luto@kernel.org, linux-hardening@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 18 Oct 2023 12:08:25 -0700 (PDT) On Wed, Oct 18, 2023 at 11:27=E2=80=AFAM Linus Torvalds wrote: > > On Wed, 18 Oct 2023 at 10:14, Jeff Xu wrote: > This is simply not up for discussion. Any flag for "ignore sealing" is wr= ong. > > We do have one special "unmap" case, namely "unmap_vmas()' called at > last mmput() -> __mmput() -> exit_mmap(). > > And yes, that is called at munmap() time too, but that's after the > point of no return after we've already removed the vma's from the VM > lists. So it's long after any error cases have been checked. > Ah. I see. I didn't know there was no legit case, which is what I worried about before= . this flag can be removed.