Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp832009rdb; Fri, 9 Feb 2024 02:29:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IFC3lDq2joCJ20kvlkJgo2F4gIELs/B4Zl+cnlWOJ/R+i9bwxyihpBiw8Gw//82fcR+Kf3V X-Received: by 2002:aa7:c653:0:b0:55f:f2ae:20ed with SMTP id z19-20020aa7c653000000b0055ff2ae20edmr871038edr.16.1707474592652; Fri, 09 Feb 2024 02:29:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707474592; cv=pass; d=google.com; s=arc-20160816; b=Y2GOZoxJURi4OSFX0Ai6O612QZhN+8j1lmEev2swJYDCkiHmbE8oRbg9TQubvQA0SB syRvtReaBI9WuTDTmt1jQmYTThgF2GyeCVwpt45O3IJz7Ujzw/N8JL33e5/brv6D8F3f QqDgJEaAjY0LXofpTfDwMjxyx6MV3KGp//rP0UWk5dKWkfTnv8qqck6iZBTFVXU5jO6Z OtH3VR9fAC+qPJL9Xr6pv05V0N0HmpAyXyrLLpAncwGSAVfvcG9u2yNYdWhn0KzTEGOA tjvX1y+Ligd1LBPfO9CeU1ps4qpCBGx+y7eEnSbNfY+druXO40iZqBotM1P2jA9qMRqd pOQA== 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=HHUvxWEQeOWIogeQUKI+8xGetAxWcmQWvB4EKQ6xgDY=; fh=FBXwyvV+SGN7w03McDxFUdJfJBkvPdsJF+NMjJN/mOk=; b=UMa7aBdQPgY6KmeSK5nGGQESjplT/4rf0/fXM/vlRyGvGzwUCmMoo7kMvso7dlSaC3 UMpJeDzJozVNJmP4Y3xzD/1nOeCHFGFj6iwMNV20FAu2zG4k0P3hVR/iQ4jQwihjxWPQ xPyGU0OWO4EEWNfjbWq0ZIBCU78QET+AGEohrM28euGmpEaxe29ZhrgkFXxXPRpEtExd JrmxfzDhg4KMqd0crFjNv/FVbG9bTmar5/HCoKKp/GjyWQEEALlQ89nxAW/UEpdy9Chg jJeFLiJKnptAp+PuAa7t+W0lArG2f/YIn01GDuhbojIdhzQO589/uyWsCl46SOxEs36m WODw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Ws005v4F; 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-59222-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59222-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; AJvYcCWoMOGoDYTBLTwOcVGiiWPzeUsL0u2Tm9+cGIdzVH2DHaGyP6cZ7qQMO+5Xb6MK8baeAugrHCDKCLj+Ho9JyNIegGP/T8sEA9FoQ0hAPA== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id q26-20020a50c35a000000b00560b79e9520si735644edb.239.2024.02.09.02.29.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 02:29:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59222-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Ws005v4F; 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-59222-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59222-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 6457B1F223A0 for ; Fri, 9 Feb 2024 10:29:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 716826931D; Fri, 9 Feb 2024 10:29:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Ws005v4F" 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 265F569941 for ; Fri, 9 Feb 2024 10:29:42 +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=1707474584; cv=none; b=GFKu3eWrMt24EP/35Fbnm/X7CioCDgJ0xQjYq6UZ2xgFkoQMQhzl0ZqnSvniKab796aitFB/kKlh9/yQVLUTSmAZ2p+UwaDWRH+J5AkEQN+AfkFKCAPu3ZF0Neh721FlOraMSooQV2DlFAqV7M1dL2y3sN3Iep3aLChigFoRwfI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707474584; c=relaxed/simple; bh=HHUvxWEQeOWIogeQUKI+8xGetAxWcmQWvB4EKQ6xgDY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=bJ2PRbVdGwZbNArKTbJPI6bCeNaM9sSe7/TFVnWnAatdY11HgAgzTyTHB68kGvnSVbok3xBGNR3XAqAOuD3l06A4exuyVwbmqpt2+MpiBUzbn3rjUAUDRLxrc5rGATIIxBzJk4lsvbfDQYVd/kn7FUzIjdPICAL6ZFoiUBAPXu8= 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=Ws005v4F; 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=1707474581; 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=HHUvxWEQeOWIogeQUKI+8xGetAxWcmQWvB4EKQ6xgDY=; b=Ws005v4FCME7kK0Q9VpFg5YJaMxfb8u56SlUKy/5oBOVV41aLqAHBhjfpyBfbTsXc8/1QW BsaJSsUMnfquZ00xMp36VPmYLyTK4Z1RQRIvDZ4aKQb8I45mKW5C64JMxewopYGW2PMHCq hG3WoeRXKHM6t53m0MtvGcAj+5NVPRc= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-41-EERUOpjmM0WcW_tGN8tCrg-1; Fri, 09 Feb 2024 05:29:36 -0500 X-MC-Unique: EERUOpjmM0WcW_tGN8tCrg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (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 0F5E5185A781; Fri, 9 Feb 2024 10:29:36 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.45.226.84]) by smtp.corp.redhat.com (Postfix) with SMTP id 509E82026D06; Fri, 9 Feb 2024 10:29:34 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Fri, 9 Feb 2024 11:28:19 +0100 (CET) Date: Fri, 9 Feb 2024 11:28:17 +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: <20240209102816.GA3282@redhat.com> References: <20240207114549.GA12697@redhat.com> <20240208-fragt-prospekt-7866333b15f0@brauner> <20240208135344.GD19801@redhat.com> <20240208143407.GF19801@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=us-ascii Content-Disposition: inline In-Reply-To: <20240208143407.GF19801@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 On 02/08, Oleg Nesterov 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 Yes, but iiuc send_signal_locked() should fixup si_pid/si_uid, so it is not buggy. > And why do we need it at all? Can't sys_kill() and pidfd_send_signal() > just use SEND_SIG_NOINFO? Probably yes. And even do_tkill() can use SEND_SIG_NOINFO if we change __send_signal_locked() to check the type before ".si_code = SI_USER". but then TP_STORE_SIGINFO() needs some changes... I'll try to do this later, I do not want to mix this change with the PIDFD_THREAD changes. Oleg.