Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2720553rwl; Mon, 27 Mar 2023 04:30:54 -0700 (PDT) X-Google-Smtp-Source: AKy350YoOKTPP0aCorMkiACTnMgmsAzStgOCRwuTwfV/Nc5L0iuPMTE6xA2N6MK6jIPkfbggg3Fy X-Received: by 2002:a62:1cc8:0:b0:625:8b35:3f32 with SMTP id c191-20020a621cc8000000b006258b353f32mr10310189pfc.18.1679916654604; Mon, 27 Mar 2023 04:30:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679916654; cv=none; d=google.com; s=arc-20160816; b=LNLZJCfjSYsth08wW+F6IdhOtO/ME0MkwJii4HDFdZue1kd0CpLR5UM/1PhnZiAR5g Nl3jKPGMrUImSCWiC4l+nRqlqMLeCuDbMF+TRuflYT7tx16+yNxr/O2e5PjVym2utFtj IACm7+h4aB4xE9x+OV/qHY6kiEf1v5/mRw/T5qe7plkYhYx2NTyIAof4iKkp6m2/OAjQ rg4+WvVh3L5mCxvcY2xURwXzkjSchOcqdhBb+GydNwNPW6KomoniSnq7ghQwXFOCOQQU hxNEYLU9AIOe7qzr1UvPAO4wqaH08tv3hVprdTKFt1QNSgAl784My7VCvvtfTrfy0Y7i SX6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=mfRGrWat4WK4Y8Q8toIh2J7eKaL0jEdcchM3E9jVj+4=; b=P0X+H9bMCQ2B1PN8cHu0LqRSHGIedtu1hNJpygPmo4QDbG+7EvsxhnUuh84LM5mZvQ yrqOvKCctjwl0Xs5szYAH65NvvTIWcAItgSCC/s06r0IBto3ZoRaGXqp+OR3AlNYghtk 9VWbZiwoDYf1HwtuySx3PoxUkGpHSMSwAm8dN1HCnLNGnL489lkCT2W4fCF+mEKgULhK NPdqPJU6whgfWv/9INSAHiYD4AbQ4Kwd+KuMJ3ChweGdswxsEBFTFBPQU6HYuML5EA5Q lmjltrBCEulSSQGXdsNckOeuIGkzSDL2kbAl4VKvAec2KmPpGWhaavPVMihLoSakaM89 ovlw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e17-20020a056a00163100b006260d644375si26248098pfc.298.2023.03.27.04.30.42; Mon, 27 Mar 2023 04:30:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230107AbjC0LSb (ORCPT + 99 others); Mon, 27 Mar 2023 07:18:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232241AbjC0LSX (ORCPT ); Mon, 27 Mar 2023 07:18:23 -0400 Received: from mail-yw1-f172.google.com (mail-yw1-f172.google.com [209.85.128.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 463F84494; Mon, 27 Mar 2023 04:18:21 -0700 (PDT) Received: by mail-yw1-f172.google.com with SMTP id 00721157ae682-54184571389so163693597b3.4; Mon, 27 Mar 2023 04:18:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679915900; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=mfRGrWat4WK4Y8Q8toIh2J7eKaL0jEdcchM3E9jVj+4=; b=Ik4pJ/LDSlQW6gfewQq9CBduADiIhHhD5rCD7sENxbNV3yJI7R3elWlp+M4rw2XKP8 bnpU31oyHabigHYVPeHGOPwdBM42gsiucMpzfA+p2/r1mLiH8n/HZFz//3AbXWMwuavg 6oSi/i2Bo7FmvUmRiucksWVSe/lHVXgdwYV0VvzY5LQ5m79jqfVe58z/3pzOhoQVWRsQ +S+ZhPmZs4F3PbBnSGlzZsjtdEGfAE34zLi58yVW7QdYTNPNsGShY4/xkD6sdBeLrWUW YS/pZq9i9TfcKO33VE2ZRRMMofZOJIm61jXNC95e++0lWdSrA3ykGFhHLl6B4FRnV3K2 2pNQ== X-Gm-Message-State: AAQBX9f0xxA2VpcTKzykgQPo9sd9a5BXJv3a6qP0AX6PeA30EDvLCmVQ ZJb/tJ828K4Im4NEPlfJV2CWLPHCyL2stA== X-Received: by 2002:a0d:d7c4:0:b0:545:b05f:6722 with SMTP id z187-20020a0dd7c4000000b00545b05f6722mr10137992ywd.10.1679915900076; Mon, 27 Mar 2023 04:18:20 -0700 (PDT) Received: from mail-yb1-f171.google.com (mail-yb1-f171.google.com. [209.85.219.171]) by smtp.gmail.com with ESMTPSA id u16-20020a81b610000000b00545a0818481sm1891818ywh.17.2023.03.27.04.18.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 27 Mar 2023 04:18:19 -0700 (PDT) Received: by mail-yb1-f171.google.com with SMTP id b18so10048879ybp.1; Mon, 27 Mar 2023 04:18:19 -0700 (PDT) X-Received: by 2002:a25:abee:0:b0:b68:7a4a:5258 with SMTP id v101-20020a25abee000000b00b687a4a5258mr7133480ybi.3.1679915899162; Mon, 27 Mar 2023 04:18:19 -0700 (PDT) MIME-Version: 1.0 References: <20230316131526.283569-1-aleksandr.mikhalitsyn@canonical.com> <7b4f8261bd3cc76c123ee7fbd176ca6a82387dce.camel@debian.org> In-Reply-To: <7b4f8261bd3cc76c123ee7fbd176ca6a82387dce.camel@debian.org> From: Luca Boccassi Date: Mon, 27 Mar 2023 11:18:08 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH net-next 0/3] Add SCM_PIDFD and SO_PEERPIDFD To: Alexander Mikhalitsyn , davem@davemloft.net Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Eric Dumazet , Jakub Kicinski , Paolo Abeni , Leon Romanovsky , David Ahern , Arnd Bergmann , Kees Cook , Christian Brauner , smcv@collabora.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=0.5 required=5.0 tests=FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 20 Mar 2023 at 14:35, Luca Boccassi wrote: > > On Thu, 2023-03-16 at 14:15 +0100, Alexander Mikhalitsyn wrote: > > 1. Implement SCM_PIDFD, a new type of CMSG type analogical to SCM_CREDENTIALS, > > but it contains pidfd instead of plain pid, which allows programmers not > > to care about PID reuse problem. > > > > 2. Add SO_PEERPIDFD which allows to get pidfd of peer socket holder pidfd. > > This thing is direct analog of SO_PEERCRED which allows to get plain PID. > > > > 3. Add SCM_PIDFD / SO_PEERPIDFD kselftest > > > > Idea comes from UAPI kernel group: > > https://uapi-group.org/kernel-features/ > > > > Big thanks to Christian Brauner and Lennart Poettering for productive > > discussions about this. > > > > Cc: "David S. Miller" > > Cc: Eric Dumazet > > Cc: Jakub Kicinski > > Cc: Paolo Abeni > > Cc: Leon Romanovsky > > Cc: David Ahern > > Cc: Arnd Bergmann > > Cc: Kees Cook > > Cc: Christian Brauner > > > > Alexander Mikhalitsyn (3): > > scm: add SO_PASSPIDFD and SCM_PIDFD > > net: core: add getsockopt SO_PEERPIDFD > > selftests: net: add SCM_PIDFD / SO_PEERPIDFD test > > I've implemented support for this in dbus-daemon: > > https://gitlab.freedesktop.org/dbus/dbus/-/merge_requests/398 > > It's working very well. I am also working on the dbus-broker and polkit > side of things, will share the links here once they are in a reviewable > state. But the dbus-daemon implementation is enough to meaningfully > test this. > > For the series: > > Tested-by: Luca Boccassi Polkit changes: https://gitlab.freedesktop.org/polkit/polkit/-/merge_requests/154