Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2563510rdg; Mon, 16 Oct 2023 08:07:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH2ubt0EZLwjkcjo4ZfUgaNM6j/Wku437yKekXv8mwMmX+rcLLqClKZtCCy7w/c4MqGUHgo X-Received: by 2002:a17:90b:30ca:b0:27d:1df4:2920 with SMTP id hi10-20020a17090b30ca00b0027d1df42920mr12596865pjb.34.1697468833787; Mon, 16 Oct 2023 08:07:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697468833; cv=none; d=google.com; s=arc-20160816; b=WjoX+OnMkToM8vwROxCetf9rPuekDIp4rYbGlLjkEE5i2FVzSchgqUMzz6FGb4r+6c tFev8vyi32eJHAsyftWOmeFwnYyKt+Uu2sgBL/67vvJUtWPd3STs4WPy2F6q91CM0G5V 3c7S7SfvdPoZUQPrVg/0nhY0ziF1rwxcQYcgZZUrJr0M//qdpuybSrxS7nKDShBR/WcY 0/vKra3TScQPZThEdD+bEJcqqi4jsDFMYaSC/OPh2N26WYRWhXyg4iqnNadHrYZyHnGQ IEmG518llWgHDizh/rvv6Ef2pIT6q5ia0dxIRHmml6HHa7j9Vkvvte+jpae8QRuFaCYj Ac4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=JDrJBZYG3xEq8iRoRfNjvUVSesTfQ4U41JLvuRFgNYE=; fh=XDs4v4Ki05mbhuOink7HOuYYQQQkJav1lcO/sZn0mUc=; b=cnRmPhbFSWKv/13QGDJ51oB+3Ctmqngbs+XmAsunnDwTTe/bcW/TpXpHVgbFKLq4f3 leJVVeVlLNeD6PbpdD2kAhVcrzogdMkdwOs1eVruiHcEY6c5Hw9uEm2LHkBXfXDmO+Tq DPqXpvpIFJFe5sE6OMvFPFKNMcamgS7uiwu81H5PnpqiGbhC+XQp5eX7gaVcZ9BWUEru 186iCGlsqxzgIxdDm8CtGgjZUhSSswkLu3PPCiRzkKcVoMCTv1WeSccs9r2IGJmM6rMT WkAxpuMryHG++g/s6xarO/NM8qWkxv11QB6+dGoVLMKomXvaDWdfeS6Z0/txCq/Pzy8A cKww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DY8wfejm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id p4-20020a17090b010400b0026d01e90c10si6115400pjz.65.2023.10.16.08.07.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 08:07:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DY8wfejm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 72954805F4BC; Mon, 16 Oct 2023 08:07:11 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233847AbjJPPG4 (ORCPT + 99 others); Mon, 16 Oct 2023 11:06:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233793AbjJPPGy (ORCPT ); Mon, 16 Oct 2023 11:06:54 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 805C4D9; Mon, 16 Oct 2023 08:06:53 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9EC7BC433C9; Mon, 16 Oct 2023 15:06:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1697468813; bh=GCcpSZHz166979U6vHgX4cVsCXfd7NMyD8cEsvnOS8E=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DY8wfejmM71V/4hCVydHZ+QhMceo63CcT9Ew3cgKYqqokpfzXOO78fC1SLFQ/C1px Fjq/n3TPno7gzRCfzzlYx7PL1xYsjXAGXGHD1NNcTY+iXHT7OkpapmwZbzKEhEUsz3 3yB/5EwhAXNqLjuUsA7lqDt3fEttcxec/ezXdrEY= Date: Mon, 16 Oct 2023 17:05:07 +0200 From: Greg KH To: jeffxu@chromium.org Cc: akpm@linux-foundation.org, keescook@chromium.org, sroettger@google.com, jeffxu@google.com, jorgelo@chromium.org, groeck@chromium.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org, jannh@google.com, 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, torvalds@linux-foundation.org, lstoakes@gmail.com, willy@infradead.org, 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 Subject: Re: [RFC PATCH v1 1/8] Add mseal syscall Message-ID: <2023101614-scarce-discount-d7ff@gregkh> References: <20231016143828.647848-1-jeffxu@chromium.org> <20231016143828.647848-2-jeffxu@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231016143828.647848-2-jeffxu@chromium.org> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.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 (pete.vger.email [0.0.0.0]); Mon, 16 Oct 2023 08:07:11 -0700 (PDT) On Mon, Oct 16, 2023 at 02:38:20PM +0000, jeffxu@chromium.org wrote: > +#ifdef CONFIG_MSEAL > + /* > + * bit masks for seal. > + * need this since vm_flags is full. > + */ > + unsigned long vm_seals; /* seal flags, see mm.h. */ "unsigned long" and yet: > diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h > index c0cb22cd607d..f574c7dbee76 100644 > --- a/include/linux/syscalls.h > +++ b/include/linux/syscalls.h > @@ -802,6 +802,8 @@ asmlinkage long sys_process_mrelease(int pidfd, unsigned int flags); > asmlinkage long sys_remap_file_pages(unsigned long start, unsigned long size, > unsigned long prot, unsigned long pgoff, > unsigned long flags); > +asmlinkage long sys_mseal(unsigned long start, size_t len, unsigned int types, > + unsigned int flags); "unsigned int"? Why the mis-match? > --- a/include/uapi/linux/mman.h > +++ b/include/uapi/linux/mman.h > @@ -55,4 +55,10 @@ struct cachestat { > __u64 nr_recently_evicted; > }; > > +#define MM_SEAL_MSEAL 0x1 > +#define MM_SEAL_MPROTECT 0x2 > +#define MM_SEAL_MUNMAP 0x4 > +#define MM_SEAL_MMAP 0x8 > +#define MM_SEAL_MREMAP 0x10 I think we can use the BIT() macro in uapi .h files now, it is _BITUL(). Might want to use it here too to make it obvious what is happening. thanks, greg k-h