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.
Showing the changes to include/uapi/linux (1 of 3 files). Show all
Unified · Split
| @@ -1652,6 +1652,7 @@ union bpf_attr { · 1651 unmodified lines | ||
| 1652 | 1652 | }; |
| 1653 | 1653 | __u32 next_id; |
| 1654 | 1654 | __u32 open_flags; |
| 1655 | + __s32 fd_by_id_token_fd; | |
| 1655 | 1656 | }; |
| 1656 | 1657 | |
| 1657 | 1658 | struct { /* anonymous struct used by BPF_OBJ_GET_INFO_BY_FD */ |