Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit f3dd0c5

Browse files
committed
bpf: add missing header file include
Commit 74e19ef ("uaccess: Add speculation barrier to copy_from_user()") built fine on x86-64 and arm64, and that's the extent of my local build testing. It turns out those got the <linux/nospec.h> include incidentally through other header files (<linux/kvm_host.h> in particular), but that was not true of other architectures, resulting in build errors kernel/bpf/core.c: In function ‘___bpf_prog_run’: kernel/bpf/core.c:1913:3: error: implicit declaration of function ‘barrier_nospec’ so just make sure to explicitly include the proper <linux/nospec.h> header file to make everybody see it. Fixes: 74e19ef ("uaccess: Add speculation barrier to copy_from_user()") Reported-by: kernel test robot <lkp@intel.com> Reported-by: Viresh Kumar <viresh.kumar@linaro.org> Reported-by: Huacai Chen <chenhuacai@loongson.cn> Tested-by: Geert Uytterhoeven <geert@linux-m68k.org> Tested-by: Dave Hansen <dave.hansen@linux.intel.com> Acked-by: Alexei Starovoitov <alexei.starovoitov@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 5b7c4ca commit f3dd0c5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

kernel/bpf/core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include <linux/log2.h>
3535
#include <linux/bpf_verifier.h>
3636
#include <linux/nodemask.h>
37+
#include <linux/nospec.h>
3738
#include <linux/bpf_mem_alloc.h>
3839
#include <linux/memcontrol.h>
3940

0 commit comments

Comments
 (0)