Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp3316279rwl; Mon, 27 Mar 2023 12:12:43 -0700 (PDT) X-Google-Smtp-Source: AKy350YTEt9p4BgAkUChTQROxUjFgph9L5oh2/2R9Q97kdrTplHxibiQVqelIbTjS98VGVT4dKq1 X-Received: by 2002:a62:4e10:0:b0:5a8:aca5:817d with SMTP id c16-20020a624e10000000b005a8aca5817dmr11335872pfb.5.1679944363124; Mon, 27 Mar 2023 12:12:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679944363; cv=none; d=google.com; s=arc-20160816; b=0Bgu7LDsAs7SMvAu+AMjNF7d739TSOckPCXzB8eh5+Sgb+rIKZpMjQqMCrZocQAoVR yMEYpRlyiHuIW8IPFRJOZuSG7phYslfG5B27KWAo0eiYBSJL28I7WqIEkomedD9ODoXW Jjwc2mWBMa2qsEpa6Ws1c8+ZsAwQEFy3crbD/Vio8HCK/8mSuOMJ4fZJsKY0+tgo3RDy SzzQ5E2rctEJXZ+g7BDnqBD6YuBjHfr3o50GUtsku+3IGB4+RLcUKrCIZAPYiSqCJ1vI n48ooCqWhSeKRzy8xe48iILYcntL2KPMrnRXVUNInbuAXxzA2NodYGjJJwZAvmpS/Amu SCXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=5gBuPNoKep58jZJZ2A7T/PwMZj21euhJkbbmerZDQl8=; b=vxdn3cwuPLVfHLZTb32YykDNgeEPBRiOQK8dj5auRui5jh4AkYAjDlR88xZqF6V6gI uid+qvdu4LsxoGopQ8KomnlKnp9AU/KKStNkDj+oSfqfgq5KBwqHQ3NKbHWiY83nDOrP MQ0HuGSVuseynLKAokY8Yuz3uD8hDM2DPWXhY8gUv2+nb31U9jhgc8alHLXpelBKiSU2 gA+Zn4lXwwz2HwqdfmEXVFSsFbzTFuVWftW0+zachzYFnPtN32J/6YN5xI8RDtjTeYR9 5oS66qBtO/PNU/1qKdahDR93Nuk/bo++h8JLZT4xM9cOZiFMs45OfjHxYDW1sXpisJ2g zxmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="sw05c/rO"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g1-20020a056a001a0100b00625e8ef7241si27916212pfv.30.2023.03.27.12.12.31; Mon, 27 Mar 2023 12:12:43 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="sw05c/rO"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232474AbjC0TER (ORCPT + 99 others); Mon, 27 Mar 2023 15:04:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229946AbjC0TEQ (ORCPT ); Mon, 27 Mar 2023 15:04:16 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B7401FEC; Mon, 27 Mar 2023 12:04:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id EB723B818A4; Mon, 27 Mar 2023 19:04:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ADE7DC4339B; Mon, 27 Mar 2023 19:04:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679943851; bh=5gBuPNoKep58jZJZ2A7T/PwMZj21euhJkbbmerZDQl8=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=sw05c/rO4PxHWF3R2aaZ8OKUInpF3cxm0e2+Sf69qvtnKH7XVIWehtO+3owXuSiWF /3uDucZMvDBifEbDl692VTOoJYS5ymNBir9tdKub8ik2q24652nJyuku4MxlrXy5L4 tcxksh1WgwNRFg6WrWS1c8CbauK+WWYM0zzn6rNLqudqNOXY6luQ4G0jWIZ0sICBpx 4CuK4QQTdiiLPx8W7EKm+peW4l/HiVM36ekjeYBA81SMIugfL6wG1/j5ur1VvU/5Rr 2ucsB8JgRMx5QSCz+2ug8KOc95Pu5Pnc1OnGZU7Etjzgm5jyx4XHdEN9Muk507tncb TJFbuhGiN+vjQ== Received: by mail-lf1-f41.google.com with SMTP id c29so12796902lfv.3; Mon, 27 Mar 2023 12:04:11 -0700 (PDT) X-Gm-Message-State: AAQBX9fRYwA2dZ2DIPj3vRfcMTuqygjOaKwOMFL2/V+7oFY4j+T2TLSy XzKMjOPAIHk2Cxa/VVdTCfb5vxscN9DzBFhbuqc= X-Received: by 2002:ac2:5dd7:0:b0:4e8:5f14:20fb with SMTP id x23-20020ac25dd7000000b004e85f1420fbmr3873834lfq.3.1679943849639; Mon, 27 Mar 2023 12:04:09 -0700 (PDT) MIME-Version: 1.0 References: <20230326092208.13613-1-laoar.shao@gmail.com> In-Reply-To: <20230326092208.13613-1-laoar.shao@gmail.com> From: Song Liu Date: Mon, 27 Mar 2023 12:03:56 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH bpf-next 00/13] bpf: Introduce BPF namespace To: Yafang Shao Cc: ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, jolsa@kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable 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 Sun, Mar 26, 2023 at 2:22=E2=80=AFAM Yafang Shao = wrote: > > Currently only CAP_SYS_ADMIN can iterate BPF object IDs and convert IDs > to FDs, that's intended for BPF's security model[1]. Not only does it > prevent non-privilidged users from getting other users' bpf program, but > also it prevents the user from iterating his own bpf objects. > > In container environment, some users want to run bpf programs in their > containers. These users can run their bpf programs under CAP_BPF and > some other specific CAPs, but they can't inspect their bpf programs in a > generic way. For example, the bpftool can't be used as it requires > CAP_SYS_ADMIN. That is very inconvenient. Agreed that it is important to enable tools like bpftool without CAP_SYS_ADMIN. However, I am not sure whether we need a new namespace for this. Can we reuse some existing namespace for this? If we do need a new namespace, maybe we should share some effort with tracer namespace proposal [1]? Thanks, Song [1] https://lpc.events/event/16/contributions/1237/