[PATCH] BPF: Include missing nospec.h to avoid build error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit 74e19ef0ff8061ef55957c3a ("uaccess: Add speculation barrier to
copy_from_user()") defines a default barrier_nospec() and removes the
#ifdefs in kernel/bpf/core.c, but doesn't include nospec.h, which causes
such a build error:

  CC      kernel/bpf/core.o
kernel/bpf/core.c: In function ‘___bpf_prog_run’:
kernel/bpf/core.c:1913:3: error: implicit declaration of function ‘barrier_nospec’; did you mean ‘barrier_data’? [-Werror=implicit-function-declaration]
   barrier_nospec();
   ^~~~~~~~~~~~~~
   barrier_data
cc1: some warnings being treated as errors

So include nospec.h to avoid the build error.

Fixes: 74e19ef0ff8061ef55957c3a ("uaccess: Add speculation barrier to copy_from_user()")
Signed-off-by: Huacai Chen <chenhuacai@xxxxxxxxxxx>
---
 kernel/bpf/core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c
index 430c66d59ec7..f9c3b1033ec3 100644
--- a/kernel/bpf/core.c
+++ b/kernel/bpf/core.c
@@ -34,6 +34,7 @@
 #include <linux/log2.h>
 #include <linux/bpf_verifier.h>
 #include <linux/nodemask.h>
+#include <linux/nospec.h>
 #include <linux/bpf_mem_alloc.h>
 
 #include <asm/barrier.h>
-- 
2.39.1




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux