bpf: Support uid and gid when mounting bpffs
authorJie Jiang <jiejiang@chromium.org>
Tue, 12 Dec 2023 09:39:23 +0000 (09:39 +0000)
committerAndrii Nakryiko <andrii@kernel.org>
Wed, 13 Dec 2023 23:37:42 +0000 (15:37 -0800)
commit750e785796bb72423b97cac21ecd0fa3b3b65610
treef45a5ce7eeff2440d7a9bce98d8f584666473ed0
parent62d9a969f4a95219c757831e9ad66cd4dd9edee5
bpf: Support uid and gid when mounting bpffs

Parse uid and gid in bpf_parse_param() so that they can be passed in as
the `data` parameter when mount() bpffs. This will be useful when we
want to control which user/group has the control to the mounted bpffs,
otherwise a separate chown() call will be needed.

Signed-off-by: Jie Jiang <jiejiang@chromium.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Mike Frysinger <vapier@chromium.org>
Acked-by: Christian Brauner <brauner@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20231212093923.497838-1-jiejiang@chromium.org
include/linux/bpf.h
kernel/bpf/inode.c