Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp376805rdb; Thu, 8 Feb 2024 08:21:42 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX7XMx7sBiqjp6za9wR0lOql+NFbCp0NngPQKIAWI3WfKK8IE2fseo02AqyFIaY2kV5ranZCW0tQUlEFx0s5kD0DV6CxrCSyWFWnrBYsQ== X-Google-Smtp-Source: AGHT+IEuXYSxOl1YMpM2AgPKHmHsxYt1c2MlLj4cYJr4Ho8TUV7UtMWtWejnslHapDnUceI2qrqt X-Received: by 2002:a17:90b:1948:b0:296:a64c:7509 with SMTP id nk8-20020a17090b194800b00296a64c7509mr6455106pjb.30.1707409302625; Thu, 08 Feb 2024 08:21:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707409302; cv=pass; d=google.com; s=arc-20160816; b=OvYv31lmmCWDsFgvECZJZ4T8+/JsHiwTeFXkyYq5y8/NtDdPneRlCYUpHUo6w93Ym9 hbvgQyDslm5cTkiXKLesuQ3jTNkJBqRFYfjW555wnUzaXMuev82VLfHaG9E8XfoQ19Kg Ija4rbA5jbxg859CHshNmsh4nBAT/ZDKfauV/aswga6l9Dv4LT0W/TyKJd+zx2FW96r3 dP9r23JfLM3tdjzniyH4tWJ1kQzTafM1PWlMFLSNBSds715ogOShqxDkQWrtJMY5DeN3 MYcUbBlFvAo9ZzxNXT9REWLu4uwF3cNEgnzIHSmwvvVw3jlnaRD+DbpMH5BqFNPoMP0r lhUw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent: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=fGN+8yem8iK2xAq/g74215xfHKUUWP3ssmQdsWN6nkk=; fh=h0TnJZ9LKiz84LWk89ugDR941zJZLdDfxzr4flLOtTo=; b=cDQA++OLOC6eHubVKMjHJhJdI7xO98RPPFlhsbdIFQLm5VUJEbtcEcwRh208uo9qz/ Ax1+Qr1XA0+fEjf6/j1Omtjgkl36DTx8jCIqM7Nvug7VvK72PjPeH5iYaQ+O3eE7wIv6 n4bBrX7nPV8DfJv303MZuPmAJRpot/RuyIn5D8TfoV6vFvHzQAdy3/uCZy5APnamotwP J8uhpBy162IAlAdzDNR8ayA5Azri9niMpCoLOJ5GdgqQFXMJaxsnLgKkMUIM2SQfHkWj c3vTdZH/OGOPmz3NaLDJybG6eSbRkUPtVZw2Byb159USvgMmn/diMqCCU/3Y898lPRI/ t8Qw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KhoLfLgy; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-58334-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58334-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Forwarded-Encrypted: i=2; AJvYcCVE/Xbk4mil38R83Ds8PJJoFI0WiYGN4A/sScW1y7qyqezVstb54JzrruBTEysRS3MnyK6ipFxh8oVjnUce62G9qS7C84f+Q4OFGTMoPQ== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 6-20020a170902ee4600b001d453cffb92si4256837plo.620.2024.02.08.08.21.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 08:21:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58334-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KhoLfLgy; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-58334-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58334-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 521FCB27EAD for ; Thu, 8 Feb 2024 16:13:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 03EC87D415; Thu, 8 Feb 2024 16:13:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="KhoLfLgy" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 C81AA7CF25 for ; Thu, 8 Feb 2024 16:13:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707408826; cv=none; b=GCVx+3BiWUO5jlG8qPfuI2a5u4kHtLggFnYw/aM39jLnKFxt7+GON87j068h2gu3wYJJe92USbWa0AHPDrfk6N4T0Gp2+6srGwDdV6Tt2L9dMmlMugzlfTr/iF8LB3gjIU/BF5SoPUpR9f83ElkZoQaRNi77/cYrq789ol6iKqM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707408826; c=relaxed/simple; bh=fGN+8yem8iK2xAq/g74215xfHKUUWP3ssmQdsWN6nkk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=uCN8M+uHOV5UdHmfncDq+daWGP7TMiljmltvncveYQnqK+Ik9mOhjPStX+kIOO65uWBlVGAUvNVyJCVG+PD91MhOBVUsHFS2uxxbqN/vv62bMDu/uhWAjllsDks57GBsn2wPY5KyP/fbL4tYVoMjkHsxnv3wZTJWu+34m0Q6V9k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=KhoLfLgy; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707408823; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=fGN+8yem8iK2xAq/g74215xfHKUUWP3ssmQdsWN6nkk=; b=KhoLfLgybZo6mZVGUELNTX5kjiGnDbP/D5QKt8RPHF0+kNBH8XgwrJbbsCEwCsjMOtTrPN yQgEUDTccy/HZFuo69CfyMEPFNR0Vz9vUgK73L9LGCnSTpY8AXQ4r4lBMa9uwZcqnMctx3 NqfqIo4Uq8yUShm57NW0rt0TwXLTrgI= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-441-lBOwh8qBM6KbU3EH3hgsWQ-1; Thu, 08 Feb 2024 11:13:02 -0500 X-MC-Unique: lBOwh8qBM6KbU3EH3hgsWQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 155803C28653; Thu, 8 Feb 2024 16:12:37 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.45.224.158]) by smtp.corp.redhat.com (Postfix) with SMTP id 71A841C14B0E; Thu, 8 Feb 2024 16:12:35 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Thu, 8 Feb 2024 17:11:21 +0100 (CET) Date: Thu, 8 Feb 2024 17:11:19 +0100 From: Oleg Nesterov To: Christian Brauner Cc: Andy Lutomirski , "Eric W. Biederman" , Tycho Andersen , linux-api@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] pidfd: change pidfd_send_signal() to respect PIDFD_THREAD Message-ID: <20240208161118.GI19801@redhat.com> References: <20240207114549.GA12697@redhat.com> <20240208-fragt-prospekt-7866333b15f0@brauner> <20240208135344.GD19801@redhat.com> <20240208143407.GF19801@redhat.com> <20240208-klopapier-aushebeln-446ac80a6e9b@brauner> 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-Disposition: inline In-Reply-To: <20240208-klopapier-aushebeln-446ac80a6e9b@brauner> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 On 02/08, Christian Brauner wrote: > > > Is prepare_kill_siginfo() correct when we send a signal to the child > > pid namespace? si_pid = task_tgid_vnr(current) doesn't look right in > > this case but perhaps I am totally confused. > > > > And why do we need it at all? Can't sys_kill() and pidfd_send_signal() > > just use SEND_SIG_NOINFO? > > Yeah, good point. I don't remember as it's been quite a while ago. My > guess is that it just tried to mirror kill() itself without being aware > of SEND_SIG_NOINFO. If you don't find anything wrong with this then > switch it to SEND_SIG_NOINFO in a preparatory patch we can backport, > please. Yes, but I still feel I must have missed something. Will read this code tomorrow. And another note for the record before I forget this. We can probably improve and rename access_pidfd_pidns(). Currently it is only used by pidfd_send_signal() but pidns_install() looks like another user. Oleg.