Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1381169rda; Mon, 23 Oct 2023 10:44:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH/eYeP6E8cpZ6IKTPA5KUQvE569qOHBMNmdNgCEGfiomD1zU3XIwk+xX+RrsNUSRRONWfQ X-Received: by 2002:a05:6870:65a9:b0:1e9:bda0:774 with SMTP id fp41-20020a05687065a900b001e9bda00774mr11641711oab.25.1698083089804; Mon, 23 Oct 2023 10:44:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698083089; cv=none; d=google.com; s=arc-20160816; b=bp9It0XufZaTGFyk8luCALPC0Es/1qgq1qiPW6H5IkgsEZwAaZPOZdxrqfy6xg4Kz0 7a8hxBx52qymf8CwphT/YGGeDx0TTJXzeCDE56kogIuepPU+nX+vFBu6PlSRg7Hl/KVc QZVsMjovvJwW4yqw64jZWpZ5ctHr3I6zY/byYohPX9322CuY5SsTK1nuQEaws6T+w+0z i0+SF6KTsVE1x4FK2isoy2r+Z0eongHjTnk8yYP2+GkKFqnD7EhFKX6Vej6UvSO6hUDf p+q+eGgXzkUv3xtMcusjitjWqCW57+if8mdugyy3O/EChFb3p7lZEfBEfs8BDqFU11L2 DFoQ== 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=W7G5ETqm85R+O8rjCffN/EgWaevuGBBGp+Yfy1oHvZI=; fh=V/KbJZhaU3Xbahvud5I/D6qDrahttx+Eu7QnIISkgr0=; b=MubNAceBBsayUq+fW+GSQEgsvx/6j3BFr2/pggx+uehSCAjdrU7r3DcA4QnlYUtagq bjwePetpBSrYFJ8XHmOToElMDzqG6e+2jp+dcvaRB4VCuyiy6WQN1Cue2/qO/yYBLBVk vokMq4/Zv4AFkoNrFtrknD2l9qimfbdFb7QApuyKEdw21PPP/CM1prcy7JGN+s8h0I57 yMw0Gqw2FQQ58rFenvmqKVmjbRK9mcHnPzZbByoge1dUsy+ad4COw2mX2oBMv2yyhzw+ EIGPP1dClAWGEFvgNCtjtAwOgSYcL2SHyclXGwht8G0NI3zdzjnuomdm5fownsS8IoX3 /RUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=keG0lQJO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id b26-20020a63931a000000b005b8878c9b01si5472677pge.309.2023.10.23.10.44.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 10:44:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=keG0lQJO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 19A6F8032EF6; Mon, 23 Oct 2023 10:44:47 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233944AbjJWRod (ORCPT + 99 others); Mon, 23 Oct 2023 13:44:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233933AbjJWRob (ORCPT ); Mon, 23 Oct 2023 13:44:31 -0400 Received: from mail-oa1-x34.google.com (mail-oa1-x34.google.com [IPv6:2001:4860:4864:20::34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08003D68 for ; Mon, 23 Oct 2023 10:44:29 -0700 (PDT) Received: by mail-oa1-x34.google.com with SMTP id 586e51a60fabf-1c0fcbf7ae4so2709492fac.0 for ; Mon, 23 Oct 2023 10:44:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1698083068; x=1698687868; 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=W7G5ETqm85R+O8rjCffN/EgWaevuGBBGp+Yfy1oHvZI=; b=keG0lQJOTiUGod+aXy/v/c2aUbTY+vdZYc4pxe61FZ8WdY54LwR3RrIfMox3w/599W 2Sbq1GnRUjQRfrUAWCL0oGQP/B5udJAMuMjh3/o3O15HgSxcVJWNiAKHtcC8v7KKJenU A4PZIxhMPoVBdrRLI8kOAQTSkFrExShXLMhhM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698083068; x=1698687868; 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=W7G5ETqm85R+O8rjCffN/EgWaevuGBBGp+Yfy1oHvZI=; b=d+fsmJ6/CPeoDGVyjZtQ4fIEcbZuZoYoUBB8aJT4+S/VQIIMm2esPCveBXZo64fS+9 I298J37S4h/3/tyMapxNdYFiN1CJMXUCyolk4MXhYVAr2bhO21+MWwymXfVpoY5d+E6D 0OwVLlIHFxvejgjL29eqX4XhdPV4f/RtPsa7gTKy3W/zb1QbGBQLqxyFMY7TCkUGudc6 OV96VDCq3w8fSLNYhh4dMOe1MY2W10vhidYU3uZYM2MG6mYygsAgiF6a1mXkKtl7qM2P zouyM8VqFoTu5L9FEBQXodUjkfognvB81e9i3IAhQYVhTHmLPaeV3vYHm+1KDdIv4Gnj xPEg== X-Gm-Message-State: AOJu0YyLo07ZgGgOzisWxMC2zEVmby1F53WE2ACcX1CiOAYJxaovXXcD +LwByd6zgUfV0Nf8G2J5ebe3Hbubs/JVbOBcNmZYhA== X-Received: by 2002:a05:6870:5312:b0:1ea:9898:c07f with SMTP id j18-20020a056870531200b001ea9898c07fmr12881189oan.22.1698083068251; Mon, 23 Oct 2023 10:44:28 -0700 (PDT) MIME-Version: 1.0 References: <20231016143828.647848-1-jeffxu@chromium.org> In-Reply-To: From: Jeff Xu Date: Mon, 23 Oct 2023 10:44:16 -0700 Message-ID: Subject: Re: [RFC PATCH v1 0/8] Introduce mseal() syscall To: Linus Torvalds Cc: Pedro Falcato , Jeff Xu , Matthew Wilcox , akpm@linux-foundation.org, keescook@chromium.org, sroettger@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, 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=-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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Mon, 23 Oct 2023 10:44:47 -0700 (PDT) On Thu, Oct 19, 2023 at 4:06=E2=80=AFPM Linus Torvalds wrote: > > On Thu, 19 Oct 2023 at 15:47, Pedro Falcato wro= te: > > > > > > For mprotect()/mmap(), is Linux implementation limited by POSIX ? > > > > No. POSIX works merely as a baseline that UNIX systems aim towards. > > You can (and very frequently do) extend POSIX interfaces (in fact, > > it's how most of POSIX was written, through sheer > > "design-by-committee" on a bunch of UNIX systems' extensions). > > We can in extreme circumstances actually go further than that, and not > only extend on POSIX requirements, but actively even violate them. > > It does need a very good reason, though, but it has happened when > POSIX requirements were simply actively wrong. > > For example, at one point POSIX required > > int accept(int s, struct sockaddr *addr, size_t *addrlen); > > which was simply completely wrong. It's utter shite, and didn't > actually match any reality. > > The 'addrlen' parameter is 'int *', and POSIX suddenly trying to make > it "size_t" was completely unacceptable. > > So we ignored it, told POSIX people that they were full of sh*t, and > they eventually fixed it in the next version (by introducing a > "socklen_t" that had better be the same as "int"). > > So POSIX can simply be wrong. > > Also, if it turns out that we had some ABI that wasn't > POSIX-compatible, the whole "don't break user space" will take > precedence over any POSIX concerns, and we will not "fix" our system > call if people already use our old semantics. > > So in that case, we generally end up with a new system call (or new > flags) instead. > > Or sometimes it just is such a small detail that nobody cares - POSIX > also has a notion of documenting areas of non-conformance, and people > who really care end up having notions like "conformance vs _strict_ > conformance". > > Linus > Thanks Linus for clarifying the guidelines on POSIX in Linux. -Jeff