]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
bpf: add missing header file include
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 22 Feb 2023 17:52:32 +0000 (09:52 -0800)
committerAndrea Righi <andrea.righi@canonical.com>
Thu, 9 Mar 2023 14:58:31 +0000 (15:58 +0100)
commitfabdc18189b6a10896c2959c7741aa031ba34001
tree5e6a624fe3e452263c1447f638f6e37de3525b80
parente44257e0f4943849ad4af1b3782a7fd0e5ffd330
bpf: add missing header file include

BugLink: https://bugs.launchpad.net/bugs/2009127
commit f3dd0c53370e70c0f9b7e931bbec12916f3bb8cc upstream.

Commit 74e19ef0ff80 ("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: 74e19ef0ff80 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
kernel/bpf/core.c