Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp1145222rdb; Fri, 16 Feb 2024 06:46:39 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUlxCHzRbg8dg37RcW2d4wwClaq0ltUgRsy1+EyT3XoNXuK0pFQ/cc7A5qw3FFyAu+b3a5REf4DX3XWri3KLE28x/KZERHCc4MkfYSlxg== X-Google-Smtp-Source: AGHT+IExbbNnzq3OTiOIsMDUOgWbyt3nr1nODLSiW8DH04TdKMFNgTGhOL39b5rQ4PfjWIzGMom0 X-Received: by 2002:a05:6358:5928:b0:176:5a5e:4b7c with SMTP id g40-20020a056358592800b001765a5e4b7cmr6057172rwf.6.1708094799003; Fri, 16 Feb 2024 06:46:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708094798; cv=pass; d=google.com; s=arc-20160816; b=bXYkiW406xjYNBizTQtwIxsxhLPLIrn/gFRc+V/JIqNcoaZ358l+Dp7/nMZZta/L3W Kr3TRH6bPMsVue10IA/sNqheMKaXTltb8ceq/XIkq2wP3yf5UBj5gQgjmFcPDXR/HXjO HstfRNJygY630NhM2HIzttIGBvn6wF6lyquPjEHg84y5GCydUlgy97kygwkIEH1B04Jt nJgGDJ4cqWAqxREPbB7wfd8wpl3d8tNZhhy534n6oncLekBwFaoXby9WXg6qa2/Vmcf/ Pba7Dnj9ELEzr6OUcwCi7uu4L5Ngr6VDnfPL/xZI5/sF7nsK3BRSC0Z+gr2uIFrHYm1I x+LQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ya3U4c/rikmOt8Oj7HAPiekknLLNavExOcVGnPVAHSc=; fh=c5+wgcC53e/Tri1Y6qjwKhun+2zDBL/8f9SJuYaUy7E=; b=wm1hsS6uny33VhTVssv7byyf7u4pytkq+dlzYxPxIIGelmrIvjQfo9AWQt/kEdC+uJ uC+TW0cZmhNEVua/4AUPcOCTq5+G5j4Yx4mhnsKIu0Ezf1PfKtEXk8qpzpTIVwz014Le WRKWjyKJobdXnLRSd0OZfvfNCI/n1sMTRPn9Zuf4bcysPLpVxWC/hAhYR9RdN/Jk+Uf/ kVvWbyj8ZOCK1IMGZbzGQRi+RiuUOCUO/7xP8dSVEu4WVQyev5Hya0kiKOCjtycwyM6w Q+DcgArzuTJMschcCwePd0SUItFwFb5E1KCPTv8OINuGd3Pd2TeJyvEPiHYyKPia9GNG GVvw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=r8VKPuke; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-68758-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68758-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id l190-20020a6388c7000000b005ced19e2d21si3046040pgd.676.2024.02.16.06.46.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 06:46:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-68758-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=r8VKPuke; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-68758-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68758-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 526642868B5 for ; Fri, 16 Feb 2024 14:46:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 036BC12F373; Fri, 16 Feb 2024 14:46:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="r8VKPuke" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 1D65012EBE9; Fri, 16 Feb 2024 14:46:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708094786; cv=none; b=fu7YZB/O1ZZSFB/BoXXeyKqP1gl1Nli6nwRI4VvGr9V027iqSMXUtvYp7xKeQLjUDeIkYM0tv5oh/8BNi/FMxWCG6jnJbN9AGMER1fshS0oIXoBGoLf4X2XWECvMor9MlFHwbsNuKQ2sZlZLVVHr/2qjas52GhFp5yQaz/GJKR8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708094786; c=relaxed/simple; bh=33cDlRRDwaR+e4Orkjw/IflYx11X++xZ5hBYAy4VnMQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=UagPpPk/arAP2eXdMtP4OKhNhgRDF/E8sKVTwc4o9CzPLJokb9u5kbdqXFMDAlSlL8AptnTsLM4YquJXURQvxGNcoika09JLujofPz1gseXexOk5WxZfWWjLONaZadsEyH4VhZJRxx/9tLK1IqWfftsxLRQ1JouP/WMikJtRsY0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=r8VKPuke; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E4F26C433F1; Fri, 16 Feb 2024 14:46:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708094785; bh=33cDlRRDwaR+e4Orkjw/IflYx11X++xZ5hBYAy4VnMQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=r8VKPuked3793jdt57KiqqnBtBt0C95jH8+NaeMOa1fTUXRYPVFSgsPfW2lImKUnX 4NlRMzqfyNFFBCJ3lct3GjxcXfFFrbjKN/KUtbz7SObvMSJ1XhQopMMpEzEbZG8Iq1 RXPx58q3REphGJSnpLyg/pK1hJoXjt6GAFRaRbQGt4V9SUdqkMlYyg/79bHPd0ymGl tdxdLRV6jostbTHHhi5qkm3ir0jPgxyWNWvfpxZjsVtuxy0AF+KntT5mu3Isf1A42T TTgkquZgZukM12nnjxzgnHXRAhSMdfSUHYKYG0OQrYK03bwUpAUXkuJ2aNH/pwSE0E 2jAxMUiquZ5eA== Date: Fri, 16 Feb 2024 15:46:20 +0100 From: Christian Brauner To: Oleg Nesterov Cc: Andy Lutomirski , "Eric W. Biederman" , Tycho Andersen , linux-api@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/2] pidfd: change pidfd_send_signal() to respect PIDFD_THREAD Message-ID: <20240216-ohnedies-improvisieren-58edcc102b6a@brauner> References: <20240209155644.GD3282@redhat.com> <20240210-abfinden-beimessen-2dbfea59b0da@brauner> <20240210123033.GA27557@redhat.com> <20240210-dackel-getan-619c70fefa62@brauner> <20240210131518.GC27557@redhat.com> <20240210-chihuahua-hinzog-3945b6abd44a@brauner> <20240210165133.GD27557@redhat.com> <20240214123655.GB16265@redhat.com> <20240216-albern-aufwiegen-1de327c7dafd@brauner> <20240216130625.GA8723@redhat.com> 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=utf-8 Content-Disposition: inline In-Reply-To: <20240216130625.GA8723@redhat.com> > SI_USER means that the target can trust the values of si_pid/si_uid > in siginfo. Bah, what an annoying nonsense. I see that this can be used to emulate stuff like SI_TIMER and SI_ASYNCIO. But I very much doubt the value of e.g., emulating SI_DETHREAD. Maybe I'm missing something very obvious. In any case, thanks for keeping me honest: So wouldn't be better of just writing this as? if ((task_pid(current) != pid || type > PIDTYPE_TGID) && (kinfo.si_code >= 0 || kinfo.si_code == SI_TKILL)) goto err; So that we don't have to repeat the same exercise if we extend this to anything above PIDTYPE_PGID?