Skip to content

tools: bpftool: probe features for unprivileged users

Quentin Monnet bpf netdev 3 versions – Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 2 repliesApplied
  2. v23 patches 2 repliesSuperseded
  3. v11 patch 2 repliesSuperseded

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/3tools: bpftool: for "feature probe" define "full_mode" bool as globaltools/bpf/bpftool/feature.c+7 -80 replies
2/3tools: bpftool: allow unprivileged users to probe featurestools/bpf/bpftool/Documentation/bpftool-feature.rst tools/bpf/bpftool/Makefile tools/bpf/bpftool/bash-completion/bpftool +1 more+100 -160 replies
3/3tools: bpftool: make libcap dependency optionaltools/bpf/bpftool/Documentation/bpftool-feature.rst tools/bpf/bpftool/Makefile tools/bpf/bpftool/feature.c+38 -50 replies

Reviews trailers per patch

None of the 3 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchJohn Fastabend
SeriesA-b
1/3
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH bpf-next v3 0/3] tools: bpftool: probe features for unprivileged users

This set allows unprivileged users to probe available features with bpftool. On Daniel's suggestion, the "unprivileged" keyword must be passed on the command line to avoid accidentally dumping a subset of the features supported by the system. When used by root, this keyword makes bpftool drop the CAP_SYS_ADMIN capability and print the features available to unprivileged users only.

The first patch makes a variable global in feature.c to avoid piping too many booleans through the different functions. The second patch introduces the unprivileged probing, adding a dependency to libcap. Then the third patch makes this dependency optional, by restoring the initial behaviour (root only can probe features) if the library is not available.

Cc Richard Palethorpe <[email protected]>
Cc Michael Kerrisk <[email protected]>

v3: Update help message for bpftool feature probe ("unprivileged").

v2: Add "unprivileged" keyword, libcap check (patches 1 and 3 are new).

Quentin Monnet (3):
tools: bpftool: for "feature probe" define "full_mode" bool as global
tools: bpftool: allow unprivileged users to probe features
tools: bpftool: make libcap dependency optional

 .../bpftool/Documentation/bpftool-feature.rst |  12 +-
 tools/bpf/bpftool/Makefile                    |  13 +-
 tools/bpf/bpftool/bash-completion/bpftool     |   2 +-
 tools/bpf/bpftool/feature.c                   | 143 +++++++++++++++---
 4 files changed, 143 insertions(+), 27 deletions(-)
Signature · 1 line
2.20.1