Message ID | 20230222025048.3677315-1-chenhuacai@loongson.cn (mailing list archive) |
---|---|
State | Accepted |
Commit | 345d24a91c79f408e355c8b7e873ccde0f097eea |
Delegated to: | BPF |
Headers | show |
Series | BPF: Include missing nospec.h to avoid build error | expand |
Hello: This patch was applied to bpf/bpf.git (master) by Alexei Starovoitov <ast@kernel.org>: On Wed, 22 Feb 2023 10:50:48 +0800 you wrote: > 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 > > [...] Here is the summary with links: - BPF: Include missing nospec.h to avoid build error https://git.kernel.org/bpf/bpf/c/345d24a91c79 You are awesome, thank you!
Oh, I'm sorry but the modified commit message seems broken. Huacai On Wed, Feb 22, 2023 at 1:10 PM <patchwork-bot+netdevbpf@kernel.org> wrote: > > Hello: > > This patch was applied to bpf/bpf.git (master) > by Alexei Starovoitov <ast@kernel.org>: > > On Wed, 22 Feb 2023 10:50:48 +0800 you wrote: > > 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 > > > > [...] > > Here is the summary with links: > - BPF: Include missing nospec.h to avoid build error > https://git.kernel.org/bpf/bpf/c/345d24a91c79 > > You are awesome, thank you! > -- > Deet-doot-dot, I am a bot. > https://korg.docs.kernel.org/patchwork/pwbot.html > >
On Tue, Feb 21, 2023 at 10:27 PM Huacai Chen <chenhuacai@gmail.com> wrote: > > Oh, I'm sorry but the modified commit message seems broken. You didn't do it correctly. I fixed it up while applying.
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>
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@loongson.cn> --- kernel/bpf/core.c | 1 + 1 file changed, 1 insertion(+)