|
@@ -4474,6 +4474,10 @@ int bpf_check(struct bpf_prog **prog, union bpf_attr *attr)
|
|
struct bpf_verifer_log *log;
|
|
struct bpf_verifer_log *log;
|
|
int ret = -EINVAL;
|
|
int ret = -EINVAL;
|
|
|
|
|
|
|
|
+ /* no program is valid */
|
|
|
|
+ if (ARRAY_SIZE(bpf_verifier_ops) == 0)
|
|
|
|
+ return -EINVAL;
|
|
|
|
+
|
|
/* 'struct bpf_verifier_env' can be global, but since it's not small,
|
|
/* 'struct bpf_verifier_env' can be global, but since it's not small,
|
|
* allocate/free it every time bpf_check() is called
|
|
* allocate/free it every time bpf_check() is called
|
|
*/
|
|
*/
|