bpf: increase verifier log limit
authorAlexei Starovoitov <[email protected]>
Tue, 2 Apr 2019 04:27:46 +0000 (21:27 -0700)
committerDaniel Borkmann <[email protected]>
Wed, 3 Apr 2019 23:27:38 +0000 (01:27 +0200)
The existing 16Mbyte verifier log limit is not enough for log_level=2
even for small programs. Increase it to 1Gbyte.
Note it's not a kernel memory limit.
It's an amount of memory user space provides to store
the verifier log. The kernel populates it 1k at a time.

Signed-off-by: Alexei Starovoitov <[email protected]>
Reviewed-by: Jakub Kicinski <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
kernel/bpf/verifier.c

index b631e89e7a515a41928b815205ad71b776e0b7f2..bb27b675923cd7d96cf3ff32879ed930cf5df199 100644 (file)
@@ -7974,7 +7974,7 @@ int bpf_check(struct bpf_prog **prog, union bpf_attr *attr,
 
                ret = -EINVAL;
                /* log attributes have to be sane */
-               if (log->len_total < 128 || log->len_total > UINT_MAX >> 8 ||
+               if (log->len_total < 128 || log->len_total > UINT_MAX >> 2 ||
                    !log->level || !log->ubuf || log->level & ~BPF_LOG_MASK)
                        goto err_unlock;
        }