summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2018-04-25 19:41:06 +0200
committerDaniel Borkmann <daniel@iogearbox.net>2018-04-26 22:36:11 +0200
commitb85fab0e67b162014cd328cb4e2a8e8ae382cb8a (patch)
tree2a743c24543f955aab3c03370e779646c74fd95f /kernel
parentaf487c5777709d4b7f874fe1a33f9289d51b9adc (diff)
downloadop-kernel-dev-b85fab0e67b162014cd328cb4e2a8e8ae382cb8a.zip
op-kernel-dev-b85fab0e67b162014cd328cb4e2a8e8ae382cb8a.tar.gz
bpf: Add gpl_compatible flag to struct bpf_prog_info
Adding gpl_compatible flag to struct bpf_prog_info so it can be dumped via bpf_prog_get_info_by_fd and displayed via bpftool progs dump. Alexei noticed 4-byte hole in struct bpf_prog_info, so we put the u32 flags field in there, and we can keep adding bit fields in there without breaking user space. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/bpf/syscall.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index fe23dc5a..7bb4ff1 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -1914,6 +1914,7 @@ static int bpf_prog_get_info_by_fd(struct bpf_prog *prog,
info.load_time = prog->aux->load_time;
info.created_by_uid = from_kuid_munged(current_user_ns(),
prog->aux->user->uid);
+ info.gpl_compatible = prog->gpl_compatible;
memcpy(info.tag, prog->tag, sizeof(prog->tag));
memcpy(info.name, prog->aux->name, sizeof(prog->aux->name));
OpenPOWER on IntegriCloud