History

bpf: add BPF token support to BPF_PROG_LOAD command

Add basic support of BPF token to BPF_PROG_LOAD. Wire through a set of allowed BPF program types and attach types, derived from BPF FS at BPF token creation time. Then make sure we perform bpf_token_capable() checks everywhere where it's relevant.

Andrii Nakryiko committed 2 years ago

Commit e1cef621 parent ee54b1a9 files · +110 −26Browse files

Showing the changes to include/uapi (1 of 9 files). Show all

Unified · Split

include/uapi/linux/bpf.h+2−0
@@ -1028,6 +1028,7 @@ enum bpf_prog_type { · 1027 unmodified lines
10281028 BPF_PROG_TYPE_SK_LOOKUP,
10291029 BPF_PROG_TYPE_SYSCALL, /* a program that can execute syscalls */
10301030 BPF_PROG_TYPE_NETFILTER,
1031+ __MAX_BPF_PROG_TYPE
10311032 };
10321033
10331034 enum bpf_attach_type {
@@ -1504,6 +1505,7 @@ union bpf_attr { · 470 unmodified lines
15041505 * truncated), or smaller (if log buffer wasn't filled completely).
15051506 */
15061507 __u32 log_true_size;
1508+ __u32 prog_token_fd;
15071509 };
15081510
15091511 struct { /* anonymous struct used by BPF_OBJ_* commands */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t