Commit 0de445d
bpf: BPF token support for BPF_BTF_GET_FD_BY_ID
Currently BPF_BTF_GET_FD_BY_ID requires CAP_SYS_ADMIN, which does not
allow running it from user namespace. This creates a problem when
freplace program running from user namespace needs to query target
program BTF.
This patch relaxes capable check from CAP_SYS_ADMIN to CAP_BPF and adds
support for BPF token that can be passed in attributes to syscall.
Signed-off-by: Mykyta Yatsenko <yatsenko@meta.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20250317174039.161275-2-mykyta.yatsenko5@gmail.com1 parent 812f770 commit 0de445d
3 files changed
+23
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1652 | 1652 | | |
1653 | 1653 | | |
1654 | 1654 | | |
| 1655 | + | |
1655 | 1656 | | |
1656 | 1657 | | |
1657 | 1658 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5120 | 5120 | | |
5121 | 5121 | | |
5122 | 5122 | | |
5123 | | - | |
| 5123 | + | |
5124 | 5124 | | |
5125 | 5125 | | |
5126 | 5126 | | |
| 5127 | + | |
| 5128 | + | |
5127 | 5129 | | |
5128 | 5130 | | |
5129 | 5131 | | |
5130 | | - | |
| 5132 | + | |
| 5133 | + | |
| 5134 | + | |
| 5135 | + | |
| 5136 | + | |
| 5137 | + | |
| 5138 | + | |
| 5139 | + | |
| 5140 | + | |
| 5141 | + | |
| 5142 | + | |
| 5143 | + | |
| 5144 | + | |
| 5145 | + | |
| 5146 | + | |
5131 | 5147 | | |
| 5148 | + | |
| 5149 | + | |
| 5150 | + | |
5132 | 5151 | | |
5133 | 5152 | | |
5134 | 5153 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1652 | 1652 | | |
1653 | 1653 | | |
1654 | 1654 | | |
| 1655 | + | |
1655 | 1656 | | |
1656 | 1657 | | |
1657 | 1658 | | |
| |||
0 commit comments