diff options
author | Otavio Salvador <otavio@ossystems.com.br> | 2022-01-12 07:40:50 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-12 07:40:50 -0300 |
commit | 712fcc850e5a6d0867b0d97a0b79f1addd01998f (patch) | |
tree | d092452bebc70059ffa9f913a1daea74d656300e /kernel/bpf/core.c | |
parent | e99f775ed2f46b225106f0a156116a0080d16740 (diff) | |
parent | 0156d956a951c70743d2338132662b29aeb8847d (diff) |
Merge pull request #517 from denisdrozdov/5.4-2.3.x-imx
Merge tag 'v5.4.161' into 5.4-2.3.x-imx
Diffstat (limited to 'kernel/bpf/core.c')
-rw-r--r-- | kernel/bpf/core.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c index d9a3d995bd96..1238ef9c569d 100644 --- a/kernel/bpf/core.c +++ b/kernel/bpf/core.c @@ -523,6 +523,7 @@ int bpf_jit_enable __read_mostly = IS_BUILTIN(CONFIG_BPF_JIT_ALWAYS_ON); int bpf_jit_harden __read_mostly; int bpf_jit_kallsyms __read_mostly; long bpf_jit_limit __read_mostly; +long bpf_jit_limit_max __read_mostly; static __always_inline void bpf_get_prog_addr_region(const struct bpf_prog *prog, @@ -759,7 +760,8 @@ u64 __weak bpf_jit_alloc_exec_limit(void) static int __init bpf_jit_charge_init(void) { /* Only used as heuristic here to derive limit. */ - bpf_jit_limit = min_t(u64, round_up(bpf_jit_alloc_exec_limit() >> 2, + bpf_jit_limit_max = bpf_jit_alloc_exec_limit(); + bpf_jit_limit = min_t(u64, round_up(bpf_jit_limit_max >> 2, PAGE_SIZE), LONG_MAX); return 0; } |