Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4163393rwd; Tue, 23 May 2023 04:13:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4sky98zKOx7iPKsRdwaRLaCF32WpG9Afte2b5FmZ6iuNqTxmEVkgm8A9a828T4U9RgB5nt X-Received: by 2002:a17:90a:f48d:b0:255:a904:7a7b with SMTP id bx13-20020a17090af48d00b00255a9047a7bmr1982558pjb.26.1684840437480; Tue, 23 May 2023 04:13:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684840437; cv=none; d=google.com; s=arc-20160816; b=huBUPGiUsmV707N3wDZrrhyzHt/dnlHf7rK3LTki3VmYyFYnbvst4Mn/x36YFSPowT LGJIchHSSR7LndfMb3H7v24yAGUyerrkeVWyZX7H8WHlvK0FIAwSLmVEmw/SYJ9lz9tp ZdYdC3cWM1Ex04BNXlgV/EDvsUrr8Z41bm0CLtp1kgLc0h8mvXAB3Oc1d1k6CEluOFb/ DjCruLwxHL4w6Tm9QW31lOW/WMHXQc7o8AXp7Ms0zNSbUSBOkXcI0GfAGz1HezV84hH/ xsaN8eO2uWvn89F/274PxdCcFOpiBotjl83hhiyVbVvvGJ/k2idddIfLfXyzAJqPPb9d 6Ahg== 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=wAGJ7K0eTZatSWk95P2dmmFxGdpx5RiAx15TGeRGBa0=; b=DiQJf2wiB9UlMmlpSh2p+6bGxjSbMvYVXwlF1eDpHFN74KXFY/LeZW5MBb5ghTk/+P qF4uUwBvuOd33DVH8VMHWaLt9gLdL1IZE7YxvXcumxRNX5+C0PmYy8VvlvcxlcUbzCYO gTlvOndNtmrm88qOOXPMT0cpbXx+kvOwBjC2NjIU8qGB2GSwBfAOEC0ytd2r1F+WIUN9 4PM/+Wi1C5GkPKF6GJbGESIoeECeDGzZLocYa5281CFhaYGYFeHG4iXkUroHbk4W/Pty shYNv27xAsbXbuzKXT2qwzxyB3FhZUvU2Ba3QFbM1sevI7qtpDmZM3AZBvNjHrGfpN/k xgvg== 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 c63-20020a633542000000b0051f74e18927si596205pga.184.2023.05.23.04.13.43; Tue, 23 May 2023 04:13:57 -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 S232119AbjEWKoX (ORCPT + 99 others); Tue, 23 May 2023 06:44:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230319AbjEWKoV (ORCPT ); Tue, 23 May 2023 06:44:21 -0400 Received: from mail-yw1-f170.google.com (mail-yw1-f170.google.com [209.85.128.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9272C119; Tue, 23 May 2023 03:44:16 -0700 (PDT) Received: by mail-yw1-f170.google.com with SMTP id 00721157ae682-562108900acso67007487b3.2; Tue, 23 May 2023 03:44:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684838655; x=1687430655; 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=wAGJ7K0eTZatSWk95P2dmmFxGdpx5RiAx15TGeRGBa0=; b=FMRb7F2wf/7W58fsIYB46aD0jdmmCDrPqyyaWOFxdwwRyqahxxaNCKzpT80e5SURNQ klZU5fa16Isidz8x3vNPWVPgy0mO34i1fxus7ZHgV8E1v42UGSA3VyqDFbOQA97WMdat azp3XfE8P3CwajWf4F/BMl30/6gT8Qn9IequFLjyqesnc3WKgDE42iAm0g53T47nTvQa sXKU0AiJmlncjP6apVbmtjHvjZvegPpWocJN+UQpdbWzjgwTDz20fQwAWO+BQ4nwqIzi qomjM3UqwG70pWAew5WjWaoifAmqskTQxSif76FmOWQ2Sm6A4cGvxOqX9gVdbcnTyAHK mWJQ== X-Gm-Message-State: AC+VfDxFFTC+Zyo2pxtR1h0TQvItSUiSpVzuYCCOJpn0tEitNLDCfeUh /FnvO49VHlTTiHrZrPzvC2dWX7udZNvqFg== X-Received: by 2002:a81:8283:0:b0:565:310:f615 with SMTP id s125-20020a818283000000b005650310f615mr6461794ywf.32.1684838654814; Tue, 23 May 2023 03:44:14 -0700 (PDT) Received: from mail-yw1-f173.google.com (mail-yw1-f173.google.com. [209.85.128.173]) by smtp.gmail.com with ESMTPSA id n14-20020a819e4e000000b00552ccda9bb3sm2704819ywj.92.2023.05.23.03.44.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 23 May 2023 03:44:13 -0700 (PDT) Received: by mail-yw1-f173.google.com with SMTP id 00721157ae682-565014fc2faso25513187b3.1; Tue, 23 May 2023 03:44:13 -0700 (PDT) X-Received: by 2002:a81:4603:0:b0:55a:7d83:7488 with SMTP id t3-20020a814603000000b0055a7d837488mr13085744ywa.9.1684838652890; Tue, 23 May 2023 03:44:12 -0700 (PDT) MIME-Version: 1.0 References: <20230522132439.634031-1-aleksandr.mikhalitsyn@canonical.com> <20230522132439.634031-2-aleksandr.mikhalitsyn@canonical.com> <20230522133409.5c6e839a@kernel.org> <20230523-flechten-ortsschild-e5724ecc4ed0@brauner> In-Reply-To: <20230523-flechten-ortsschild-e5724ecc4ed0@brauner> From: Luca Boccassi Date: Tue, 23 May 2023 11:44:01 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH net-next v6 1/3] scm: add SO_PASSPIDFD and SCM_PIDFD To: Christian Brauner Cc: Jakub Kicinski , Alexander Mikhalitsyn , davem@davemloft.net, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Eric Dumazet , Paolo Abeni , Leon Romanovsky , David Ahern , Arnd Bergmann , Kees Cook , Kuniyuki Iwashima , Lennart Poettering , linux-arch@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 Tue, 23 May 2023 at 10:49, Christian Brauner wrote: > > On Mon, May 22, 2023 at 01:34:09PM -0700, Jakub Kicinski wrote: > > On Mon, 22 May 2023 15:24:37 +0200 Alexander Mikhalitsyn wrote: > > > v6: > > > - disable feature when CONFIG_UNIX=n/m (pidfd_prepare API is not exported to modules) > > > > IMHO hiding the code under #if IS_BUILTIN(CONFIG_UNRELATED) is > > surprising to the user and.. ugly? > > > > Can we move scm_pidfd_recv() into a C source and export that? > > That should be less controversial than exporting pidfd_prepare() > > directly? > > I really would like to avoid that because it will just mean that someone > else will abuse that function and then make an argument why we should > export the other function. > > I think it would be ok if we required that unix support is built in > because it's not unprecedented either and we're not breaking anything. > Bpf has the same requirement: > > #if IS_BUILTIN(CONFIG_UNIX) && defined(CONFIG_BPF_SYSCALL) > struct bpf_unix_iter_state { > struct seq_net_private p; > unsigned int cur_sk; > unsigned int end_sk; > unsigned int max_sk; > struct sock **batch; > bool st_bucket_done; > }; > > and > > #if IS_BUILTIN(CONFIG_UNIX) && defined(CONFIG_BPF_SYSCALL) && defined(CONFIG_PROC_FS) > DEFINE_BPF_ITER_FUNC(unix, struct bpf_iter_meta *meta, > struct unix_sock *unix_sk, uid_t uid) Some data points: Debian, Ubuntu, Fedora, RHEL, CentOS, Archlinux all ship with CONFIG_UNIX=y, so a missing SCM_PIDFD in unlikely to have a widespread impact, and if it does, it might encourage someone to review their kconfig. As mentioned on the v5 thread, we are waiting for this API to get the userspace side sorted (systemd/dbus/dbus-broker/polkit), so I'd be really grateful if we could start with the simplest and most conservative approach (which seems to be the current one in v6 to me), and then eventually later decide whether to export more functions, or to deprecate CONFIG_UNIX=m, or something else entirely, as that doesn't really affect the shape of the UAPI, just the details of its availability. Thank you. Kind regards, Luca Boccassi