Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7187821imu; Mon, 3 Dec 2018 09:00:20 -0800 (PST) X-Google-Smtp-Source: AFSGD/U8lyNT8FShhJKwS1oeqAzpWWE6wo1F+sZcGYIapqEGpLNczW4htgwS4vsFioC2VOlJ+UMP X-Received: by 2002:a17:902:8e8a:: with SMTP id bg10mr16812759plb.192.1543856419970; Mon, 03 Dec 2018 09:00:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543856419; cv=none; d=google.com; s=arc-20160816; b=LdvleJBvJasEB3H7dRR1rrmU3kXr4rgUNXpXQPW0EHfT+mhKpWe1TifkWXCkm14dep JjQD3XSO3B1IkdHhaAyvozSQJlE4toRt4VmIxKT5HV3VQZ3wVY4uKZbV2y/t9ZNq/pL8 xfusKBHVPjudr9HDb0rEuVOM4H/ovF5L5I6LMRdqdPLFas3+rG2l6Yt6Ma6CUrbqpNFV bLJafF1gINm+56+bLuDWJ3BuiNmXmeKO5JpCKan3y3Yvnuz2pYkfOQNl49NURoLk4XBI Fz6VL+eBW60gDkiqr+n3jHhtlk03VOBXqmYHNX+aLRMwBeSDYAuQtqvL1vV4LYPTlHCI M8bA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:message-id:in-reply-to:date:references:subject:cc:to :from; bh=C37KpVBO/pspkWYLdPk/yHBYHFjT8oxJrZ4xG/SyEuc=; b=eG0K/YQXznLXE4un1cOE8czne0Hi6y4lE9WdnBs3nlA6idK632hs4bHlTizUBv6zpD iSievuLLJdz4rVe9eAZE6r5rHU49ke2D4wrfjhoup0AjnO67OGToiklAsupR344OBNFY T3cyu8a42C8j4PbPgErfCvOI1BxN4LEpditEUQq4wRi1fCuy23I4OBmr079agVuqYQcj qeNO6Xe93Lt+SeIvNOK+0qxuLTrQ+o8Sp7O6Qfdd/d9x/pshyAFu6VCnk1Y16f1BR8bo iuvNF+aO83CDGdRBEKpxjuTy/+NrBFVVSOQ2R2rf12ktpppKSm1zYlI7kf6O4zQwxF3F x7vg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i2si14520987pfi.125.2018.12.03.08.59.58; Mon, 03 Dec 2018 09:00:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726881AbeLCQ6I convert rfc822-to-8bit (ORCPT + 99 others); Mon, 3 Dec 2018 11:58:08 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39498 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726637AbeLCQ6I (ORCPT ); Mon, 3 Dec 2018 11:58:08 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 100E230BA1E8; Mon, 3 Dec 2018 16:58:05 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-116-35.ams2.redhat.com [10.36.116.35]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 67B0960610; Mon, 3 Dec 2018 16:58:01 +0000 (UTC) From: Florian Weimer To: Christian Brauner Cc: ebiederm@xmission.com, linux-kernel@vger.kernel.org, serge@hallyn.com, jannh@google.com, luto@kernel.org, akpm@linux-foundation.org, oleg@redhat.com, cyphar@cyphar.com, viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org, dancol@google.com, timmurray@google.com, linux-man@vger.kernel.org, Kees Cook Subject: Re: [PATCH v2] signal: add procfd_signal() syscall References: <20181120105124.14733-1-christian@brauner.io> <87in0g5aqo.fsf@oldenburg.str.redhat.com> <746B7C49-CC7B-4040-A7EF-82491796D360@brauner.io> <20181202100304.labt63mzrlr5utdl@brauner.io> Date: Mon, 03 Dec 2018 17:57:51 +0100 In-Reply-To: <20181202100304.labt63mzrlr5utdl@brauner.io> (Christian Brauner's message of "Sun, 2 Dec 2018 11:03:06 +0100") Message-ID: <8736rebl9s.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Mon, 03 Dec 2018 16:58:05 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Christian Brauner: > Ok, I finally have access to source code again. Scratch what I said above! > I looked at the code and tested it. If the process has exited but not > yet waited upon aka is a zombie procfd_send_signal() will return 0. This > is identical to kill(2) behavior. It should've been sort-of obvious > since when a process is in zombie state /proc/ will still be around > which means that struct pid must still be around. Should we make this state more accessible, by providing a different error code? Will the system call ever return ESRCH, given that you have a handle for the process? >> >Looking at the rt_tgsigqueueinfo interface, is there a way to implement >> >the “tg” part with the current procfd_signal interface? Would you use >> >openat to retrieve the Tgid: line from "status"? > > Yes, the tg part can be implemented. I meant on top of the existing interface. > As I pointed out in another mail my I is to make this work by using > file descriptors for /proc//task/. I don't want this in the > initial patchset though. I prefer to slowly add those features once > we have gotten the basic functionality in. Do you want to land all this in one kernel release? I wonder how applications are supposed to discover kernel support if functionality is split across several kernel releases. If you get EINVAL or EBADF, it may not be obvious what is going on. What happens if you use the new interface with an O_PATH descriptor? Thanks, Florian