Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp1040984rdb; Fri, 2 Feb 2024 11:32:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IFjjpMtQWfQ9O+uhbwxLQUcMbRC7WCMmoscQ6XvvcHZ5XvxQ4dtqhPQGui+idijlVLdXSzY X-Received: by 2002:a05:6214:f66:b0:68c:6f1b:780d with SMTP id iy6-20020a0562140f6600b0068c6f1b780dmr8756647qvb.21.1706902350950; Fri, 02 Feb 2024 11:32:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706902350; cv=pass; d=google.com; s=arc-20160816; b=OE/ELhzzy2uXk2HoeYSoEMZQF01aI6vi86DTOvhep27FU8TAaeHEixC1uLChGU+e1a dd5prR93zwZBThOnbzhBEWjObmPQQH3MhH1cx9nMtvDXIvoNEqXRme9O1FmalASD+KcX 5wh0r6HSce/Aq596RUh0s2ic7iAqhVGcCmdJA/TeToTB8JVeqaQsHvH9yCcVkyAcnuVg /nRjLoVV0vIqUkXrbePZiX0IcSxtHlVYR8+NSOkY2MWFN24FrWUIZREP99LNViJuTTzx oXf0ve0kN6GpXe2aEToY+7grXKRdnjBwnf+BrKNLt3D259xIMeaBHX3y60dJtrrRFoIG 1x/g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:content-id:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:comments:references:in-reply-to :subject:mail-followup-to:to:from:dkim-signature; bh=iMuvp02SyYoj4JF2gtN2+jkpvA/AUkOFWxEPuAq/IjM=; fh=CQiDYISlVSL0MZGmVNVHARz/yKk98MkOG7vqoQjhbUA=; b=bWNC7mF4eTbtfbzW9sUveYFdSspVnyErsLO9GMN5WoWWB9tBLx7I1t5XJEK1wN6Bfz eteYENfwMs4kl8VfKc05JMaMKj9uGC1iBBUvmoFvY4nIjNU0NlVPy9vuT/eKxNhYLyU3 IktZlpa53PHbBbDtgUAYaeObsz5LJjwUoskWe1/Ls+Nq/MQhu3P+rP9/IaqxqF0X9m3C 9my3P69M+pTgmgwNTbwu5V0tPsfyrXBw+4avPk2ocNkur7OAJIucjZDPFtd43eFUuD7U 3S+oZL8yO8/SrpW9bS5FDag4Tt5qmNgVB6WMvn0Xc2EeDdoBiLg3MGQfb2CbLnIb5jG8 X62g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@openbsd.org header.s=selector1 header.b=ZdHsQtxZ; arc=pass (i=1 spf=pass spfdomain=openbsd.org dkim=pass dkdomain=openbsd.org); spf=pass (google.com: domain of linux-kernel+bounces-50481-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50481-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCVL5CRnjurluy+IZfVCRiqfty0ioaNlbXkPJu/0z0Yxwgqc+7Xho+SCIzxzpABQllSfmn0kjqTdfcf80CpoKZdOZhoX8zBNeyKV4oI/Ag== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id e15-20020ad450cf000000b00681936ef67dsi2648417qvq.338.2024.02.02.11.32.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 11:32:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-50481-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@openbsd.org header.s=selector1 header.b=ZdHsQtxZ; arc=pass (i=1 spf=pass spfdomain=openbsd.org dkim=pass dkdomain=openbsd.org); spf=pass (google.com: domain of linux-kernel+bounces-50481-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50481-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id AEDAF1C2243B for ; Fri, 2 Feb 2024 19:32:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F17A215E5DE; Fri, 2 Feb 2024 19:32:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=openbsd.org header.i=@openbsd.org header.b="ZdHsQtxZ" Received: from cvs.openbsd.org (cvs.openbsd.org [199.185.137.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8E10B15E5C6; Fri, 2 Feb 2024 19:32:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.185.137.3 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706902344; cv=none; b=Wm8eobPS9b80WQwr0yV3Uk8zQ7f8ApwUU5CCgImeS2vkM26xbyF64K1c5dK7aDLqtFFif1wabm9bUfezWs28N/+NaTLKxmzbnlG9kD8kyEU9SDWnjph0Eh9BF7Mj9MD/koFwOvOTz3SIfWw8d+h9P0LbzQqekETDCncrUfh8Iyc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706902344; c=relaxed/simple; bh=ekn8zZyh2SJ/K4/UbZI/dsGbE82SD/gtWKgnDxS+Csg=; h=From:To:Subject:In-reply-to:References:MIME-Version:Content-Type: Date:Message-ID; b=Uh3Rbv9YxbeoDIEGmMTUW0Di0S7H+iDZwhdGzPD6Q2jK8CuvmU2iGipB9kYS4UJfL20P6uT/WiIfeK/p6RsoKYrjfTnF2WAYctWMOX82GYbjc1WalzgLWfKL+oK1vykE25Aa2prMhYctxY+uNYYwn31rjBoIA+9Y1XHL7diWJFE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=openbsd.org; spf=pass smtp.mailfrom=openbsd.org; dkim=pass (2048-bit key) header.d=openbsd.org header.i=@openbsd.org header.b=ZdHsQtxZ; arc=none smtp.client-ip=199.185.137.3 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=openbsd.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=openbsd.org DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=selector1; bh=ekn8zZyh2S J/K4/UbZI/dsGbE82SD/gtWKgnDxS+Csg=; h=date:references:in-reply-to: subject:to:from; d=openbsd.org; b=ZdHsQtxZd7zV7xxA41DRY2ESVMUbSAnvR1xc AlK7ecM9Ucc9edCmBIKnSpBApeWQwf3odD6e7TBICtNVqhp2Zva5TXONs0ssS378pCBvkM 4lyOWSpIn7akT2yQnl1fhqedjWlWt2K7DRAapspanK04WySI/fAE7WB4yp1ASTvAcVJv76 dOREtdXKhniP8HAbBjy9NG4YE4EhcjBPAESBMP3Yu43xtw8YvyKPC3muuRLI2uNjjRC1mB 4cz9yJYYcle46GXKmS9Z4NPB4cVl9QFhxzXe68UB5hOodzmyCJfxFaqihHUt55frwCB07R gkgopKTD0GkEtx/ZgDrPzaJwnw== Received: from cvs.openbsd.org (localhost [127.0.0.1]) by cvs.openbsd.org (OpenSMTPD) with ESMTP id 78374f08; Fri, 2 Feb 2024 12:32:16 -0700 (MST) From: "Theo de Raadt" To: "Liam R. Howlett" , Jeff Xu , Jeff Xu , Jonathan Corbet , akpm@linux-foundation.org, keescook@chromium.org, jannh@google.com, sroettger@google.com, willy@infradead.org, gregkh@linuxfoundation.org, torvalds@linux-foundation.org, usama.anjum@collabora.com, rdunlap@infradead.org, jorgelo@chromium.org, groeck@chromium.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org, pedro.falcato@gmail.com, dave.hansen@intel.com, linux-hardening@vger.kernel.org Mail-Followup-To: "Liam R. Howlett" , Jeff Xu , Jeff Xu , Jonathan Corbet , akpm@linux-foundation.org, keescook@chromium.org, jannh@google.com, sroettger@google.com, willy@infradead.org, gregkh@linuxfoundation.org, torvalds@linux-foundation.org, usama.anjum@collabora.com, rdunlap@infradead.org, jorgelo@chromium.org, groeck@chromium.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org, pedro.falcato@gmail.com, dave.hansen@intel.com, linux-hardening@vger.kernel.org Subject: Re: [PATCH v8 0/4] Introduce mseal In-reply-to: <20240202192137.6lupguvhtdt72rbr@revolver> References: <20240131175027.3287009-1-jeffxu@chromium.org> <20240131193411.opisg5yoyxkwoyil@revolver> <20240201204512.ht3e33yj77kkxi4q@revolver> <20240202151345.kj4nhb5uog4aknsp@revolver> <20240202192137.6lupguvhtdt72rbr@revolver> Comments: In-reply-to "Liam R. Howlett" message dated "Fri, 02 Feb 2024 14:21:37 -0500." Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <98845.1706902336.1@cvs.openbsd.org> Date: Fri, 02 Feb 2024 12:32:16 -0700 Message-ID: <85714.1706902336@cvs.openbsd.org> > What I'm more concerned about is what happens if you call mseal() on a > range and it can mseal a portion. Like, what happens to the first vma > in your test_seal_unmapped_middle case? I see it returns an error, but > is the first VMA mseal()'ed? (no it's not, but test that) That is correct, Liam. Unix system calls must be atomic. They either return an error, and that is a promise they made no changes. Or they do the work required, and then return success. In OpenBSD, all mimmutable() aspects were carefully studied to gaurantee this behaviour. I am not an expert in the Linux kernel to make the assessment; someone who is qualified must make that assessment. Fuzzing with tests is a good way to judge it simpler.