Skip to content

Commit

Permalink
bpf: make generic bpf_jit_alloc_* depend on MODULES
Browse files Browse the repository at this point in the history
Signed-off-by: Jesse Chan <jc@linux.com>
Change-Id: I33067d0b6dbc86a87bc7aca56b96f81b3bb3d010
Signed-off-by: TogoFire <togofire@mailfence.com>
  • Loading branch information
jesec authored and TogoFire committed Sep 29, 2024
1 parent 89194fb commit 084c656
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions kernel/bpf/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,7 @@ static void bpf_jit_uncharge_modmem(u32 pages)
atomic_long_sub(pages, &bpf_jit_current);
}

#ifdef CONFIG_MODULES
void *__weak bpf_jit_alloc_exec(unsigned long size)
{
return module_alloc(size);
Expand All @@ -809,6 +810,7 @@ void __weak bpf_jit_free_exec(void *addr)
{
module_memfree(addr);
}
#endif

#if IS_ENABLED(CONFIG_BPF_JIT) && IS_ENABLED(CONFIG_CFI_CLANG)
bool __weak arch_bpf_jit_check_func(const struct bpf_prog *prog)
Expand Down

0 comments on commit 084c656

Please sign in to comment.