From mboxrd@z Thu Jan 1 00:00:00 1970 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 617A1D78321 for ; Mon, 2 Dec 2024 14:21:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C0B736B0082; Mon, 2 Dec 2024 09:21:27 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BBA8F6B0083; Mon, 2 Dec 2024 09:21:27 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A82106B0085; Mon, 2 Dec 2024 09:21:27 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 88FED6B0082 for ; Mon, 2 Dec 2024 09:21:27 -0500 (EST) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id CC7E1141B7F for ; Mon, 2 Dec 2024 14:21:26 +0000 (UTC) X-FDA: 82850231226.27.A2020B1 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf20.hostedemail.com (Postfix) with ESMTP id DB8F21C0004 for ; Mon, 2 Dec 2024 14:21:11 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=EqYolVzc; spf=pass (imf20.hostedemail.com: domain of alx@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=alx@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1733149277; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=eY2/U1swDImYMdjPuA0sBjN6UgYjP8kE0eqFOKlcuGo=; b=ivylffTUK1ePlvOF9ZKTCD/jmuN9gyhwU9LH6RYYOa5q15OoO/dPPT8JpVjXV0bT9JrjP0 zWeMq7Mb4Kx2AGbsU+PV/vMbjU6dol6YVRzOAWXOxYf5JkvzxYwxkpso5gneo7i7SqXPut 6uOh6S3ZcyyiuCE40WemRJygJJucvXo= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=EqYolVzc; spf=pass (imf20.hostedemail.com: domain of alx@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=alx@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733149277; a=rsa-sha256; cv=none; b=lEfj2R2JYO9MrI+35x78wGGJVEdWmu1JeEYFSMlWOfTA4XZOHrcNhSqqdvpCXGjsHN6dFS uPEGMp2KTbXG2FXsFY9RmwxjPTyCP1fjtBlLmEcoJGA7jd3HT42hG8PUSz/m3Iq+iHK8n0 M1YAu+LO9LnJNrAG+mPm7twr3eP5g90= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id EAE5D5C5EFC; Mon, 2 Dec 2024 14:20:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 01C35C4CED1; Mon, 2 Dec 2024 14:21:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1733149283; bh=wSctZrA9lVGIxKJ2F1ldB0RZ6xTRu7jOxQeez3ARPN4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=EqYolVzcp3Vc3qKdIpmi62EmeR7JAWHQwJM4Wci8j+ukRzTLF1d5nRje2nxPkhyyR whhY7IjEbPMOc1yl1ShlvBV6FbOwhKydL+ykb6qTA7D5PHoYSAYJZur0W0c+YgCYSM hzQKzV5r3ssrst4uYR0GJRqmevz9t2vdMGjVsTjHVifvoQFP438KGiRm3fncbQTh3b MDmjUXSVkxLVwca1Q7Pcx6JVXD7ZqvgSCSJJDKadguNpZZfrgWjQvQ7YirtPV2HFT6 DuJcUz7vnUI6mhuHLYAEwEyz474x3hAy86cP2KpfdJk5fCSYG2u5448IpBa8r79GXr pr37WOQxAzb3w== Date: Mon, 2 Dec 2024 15:21:19 +0100 From: Alejandro Colomar To: Lorenzo Stoakes Cc: Jann Horn , linux-man@vger.kernel.org, Suren Baghdasaryan , "Liam R . Howlett" , Matthew Wilcox , Vlastimil Babka , linux-mm@kvack.org Subject: Re: [PATCH man-pages v2] madvise.2: add MADV_GUARD_INSTALL, MADV_GUARD_REMOVE description Message-ID: <20241202142119.jdum36vancxhotxk@devuan> References: <20241129155943.85215-1-lorenzo.stoakes@oracle.com> <7a4bf410-09b7-4d88-bd4e-aaae5282cb37@lucifer.local> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ydxapdr3ztqlv3xs" Content-Disposition: inline In-Reply-To: <7a4bf410-09b7-4d88-bd4e-aaae5282cb37@lucifer.local> X-Rspamd-Server: rspam05 X-Stat-Signature: 9zemzdbo1qbb7hw6uam8xpwyjbid8cmy X-Rspamd-Queue-Id: DB8F21C0004 X-Rspam-User: X-HE-Tag: 1733149271-173029 X-HE-Meta: U2FsdGVkX1/GblZuTJLpLwvlZny7vNGLBB+y6mveVcZ4Shwd2xukkErhU1fhl8+KVVp/ticOwBmYE6MJvccLsrwGruyP+484FblZKWnNCLyQumS2ehCMhJvEyau6phF5JPN1PWXQBNQANEZjCOBkb5gKdq8KX0n1x+DtAtntYS80vP/LdSDxPeIzPXH/0s6+yGQHrQPF/fmfoN8upP894r89OD8mZ/+WJRdm+OYNJnplQf6IieJkK03rPpOVtAtpU/psm1cmDLt20LW6zCs5dFii1tct3YbIXA4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45u0i1gLkrhQKJxtC199LgKcCZsaOGnptUlyyhtmCBn4YtF7PKZDDzMjodW+t/CEzseZI+Z4OXFsBpZiZ71j2MVTE4c5lrDmgyHZZSgWXqcSEPHXMGdcC 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: List-Subscribe: List-Unsubscribe: --ydxapdr3ztqlv3xs Content-Type: text/plain; protected-headers=v1; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH man-pages v2] madvise.2: add MADV_GUARD_INSTALL, MADV_GUARD_REMOVE description MIME-Version: 1.0 Hi Lorenzo, Jann, On Mon, Dec 02, 2024 at 02:05:54PM +0000, Lorenzo Stoakes wrote: > On Fri, Nov 29, 2024 at 07:13:22PM +0100, Jann Horn wrote: > > On Fri, Nov 29, 2024 at 4:59=E2=80=AFPM Lorenzo Stoakes > > wrote: > > > Lightweight guard region support has been added to Linux 6.13, which = adds > > > MADV_GUARD_INSTALL and MADV_GUARD_REMOVE flags to the madvise() system > > > call. Therefore, update the manpage for madvise() and describe these > > > operations. > > [...] > > > +.TP > > > +.BR MADV_GUARD_INSTALL " (since Linux 6.13)" > > > +Install a lightweight guard region into the range specified by > > > +.I addr > > > +and > > > +.IR size , > > > +causing any read or write in the range to result in a fatal > > > +.B SIGSEGV > > > +signal being raised. > > > > Single-word nitpick: Maybe remove the word "fatal"? > > > > I think the term "fatal signal" normally refers to a signal that is > > guaranteed to terminate the task (that's how the signal handling code > > uses the term, more or less); but a SIGSEGV caused by VM_FAULT_SIGSEGV > > can AFAIK be handled by a userspace signal handler. > > > > SIGKILL is the one signal that is always fatal; the kernel can also > > send other signals in an always-fatal way, like with force_fatal_sig() > > or force_exit_sig(), but those are not used for VM_FAULT_SIGSEGV. > > (Those functions are mostly for cases where we can't continue because > > something is in an unsafe state, like if a signal return failed and > > the register state might now be messed up.) >=20 > I think there's a bit of a disconnect between the meaning of a fatal sign= al > in userland and the kernel, from the kerne's perspective as per > fatal_signal_pending(), it is, as you say, SIGKILL. >=20 > From a user's persepctive, and as per sig_fatal(), it is one that is, by > default, fatal if not handled. >=20 > So I think here it's fine to say 'fatal' in the latter sense, and the fact > we immediately mention SIGSEGV clarifies in what sense we mean 'fatal'. >=20 > The intent here also is that a user would treat this as a fatal event, a > thread that accesses a guard area is accessing memory that it shouldn't. >=20 > However I also see it from your perspective, I mean we say what signal > we're sending so it's not hugely necessary and eliminates a possible > confusion. >=20 > Not sure if Alejandro has any objection to this turn of phrase? I agree with Jann. With your interpretation, fatal SIGSEGV is redundant, as SIGSEGV is always "fatal" in that sense. It's better to just say SIGSEGV. In Jann's more formal interpretation, fatal SIGSEGV means a different thing. I prefer just SIGSEGV. >=20 > From my perspective I don't think it's too problematic to leave it in, but > if it's easy for Alejandro to pull out I have no objection. >=20 > If people feel strongly + Alejandro would find it easier, I could just se= nd > a v3 with it removed. Yeah, please send a v3. Thanks! Have a lovely day! Alex >=20 > Thanks, Lorenzo --=20 --ydxapdr3ztqlv3xs Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE6jqH8KTroDDkXfJAnowa+77/2zIFAmdNwl8ACgkQnowa+77/ 2zL4Gg//SKZyZOS6vaJ2Y29L/sN5g6Sv+0YlX6V0zXh3PxB9X9dK61QNo4+8HClx 0bJ8Fn/VkBznzF5qY/f3F2M54+QybK1Heq+eW5OV6MnImYSH2Bhy7KefoSG9dYzx veya5nuZbjQWTOGzQXioSGUpZ4U9ls1rFtBJqJTqH0SDHDeMOOd7z2nbdKBHsshe GLOaeIFOscitpyarg6RAtgv59vVOBgOI0XikTsfwghJmSfsX9riHDEV6Oe4KkxBU 6mA8BOkX7WJijRpwk28JTTkuDM9ZMTxSnxUvGu5q/LbaGPSnRZruCxgHv1cDun68 GOmNLWNtVgKxZrJzPqYzbbs7rUF8GZ3DzIxlvBgHMwCyrjC0oOumy5CFVTnlpBqL U4aoyTTINevg1pI2KN1DD6MtOB4P4dgplWPIEk7Ggp4nY+unZe35u2ZrJUbPzQmz cFMhTUENhldFuUFS8M5z2XUSlnnzzVMg7v4kjhMDZ+Q8nJHZhLjtpk5CflTRuPIO SUzHoIGCnColBE9462xLzsuIli5LMVvSfdAkJd4URkOiBUNzN3wK0ZxUV4L9CHE2 nAdAB4c/S8LUurzYLpv9zH4VWyeMtpie0RjHEaFFMdAI6VgO84ttyLp0kjtQv2j+ ps5CWU+7I/pRmk7XLPhuu+ECw/nnjrVV70SwhUcsxEuVRLVZjPU= =Cdw2 -----END PGP SIGNATURE----- --ydxapdr3ztqlv3xs--