mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 10:58:48 +09:00
Revert "Revert "bpf: program: Refuse non-O_RDWR flags in BPF_OBJ_GET""
This reverts commit 5ae3c4b3f0 and brings
it back into the tree, as the offending CTS test is now fixed up.
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ica5eefc4f2bb86482990c0e3f284a0cbd7b38258
This commit is contained in:
@@ -543,7 +543,7 @@ int bpf_obj_get_user(const char __user *pathname, int flags)
|
||||
return PTR_ERR(raw);
|
||||
|
||||
if (type == BPF_TYPE_PROG)
|
||||
ret = bpf_prog_new_fd(raw);
|
||||
ret = (f_flags != O_RDWR) ? -EINVAL : bpf_prog_new_fd(raw);
|
||||
else if (type == BPF_TYPE_MAP)
|
||||
ret = bpf_map_new_fd(raw, f_flags);
|
||||
else if (type == BPF_TYPE_LINK)
|
||||
|
||||
Reference in New Issue
Block a user