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
1028 BPF_PROG_TYPE_SK_LOOKUP,1028 BPF_PROG_TYPE_SK_LOOKUP,
1029 BPF_PROG_TYPE_SYSCALL, /* a program that can execute syscalls */1029 BPF_PROG_TYPE_SYSCALL, /* a program that can execute syscalls */
1030 BPF_PROG_TYPE_NETFILTER,1030 BPF_PROG_TYPE_NETFILTER,
1031 __MAX_BPF_PROG_TYPE
1031};1032};
1032 1033
1033enum bpf_attach_type {1034enum bpf_attach_type {
@@ -1504,6 +1505,7 @@ union bpf_attr { · 470 unmodified lines
1504 * truncated), or smaller (if log buffer wasn't filled completely).1505 * truncated), or smaller (if log buffer wasn't filled completely).
1505 */1506 */
1506 __u32 log_true_size;1507 __u32 log_true_size;
1508 __u32 prog_token_fd;
1507 };1509 };
1508 1510
1509 struct { /* anonymous struct used by BPF_OBJ_* commands */1511 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