|
@@ -14,8 +14,9 @@ int bpf_prog_offload_init(struct bpf_prog *prog, union bpf_attr *attr)
|
|
struct net *net = current->nsproxy->net_ns;
|
|
struct net *net = current->nsproxy->net_ns;
|
|
struct bpf_dev_offload *offload;
|
|
struct bpf_dev_offload *offload;
|
|
|
|
|
|
- if (!capable(CAP_SYS_ADMIN))
|
|
|
|
- return -EPERM;
|
|
|
|
|
|
+ if (attr->prog_type != BPF_PROG_TYPE_SCHED_CLS &&
|
|
|
|
+ attr->prog_type != BPF_PROG_TYPE_XDP)
|
|
|
|
+ return -EINVAL;
|
|
|
|
|
|
if (attr->prog_flags)
|
|
if (attr->prog_flags)
|
|
return -EINVAL;
|
|
return -EINVAL;
|