Commit b169caaa authored by Linus Torvalds's avatar Linus Torvalds Committed by Jialin Zhang
Browse files

bpf: add missing header file include

stable inclusion
from stable-v5.10.170
commit 12e3119a87627741bd3871c895ce198f21529eb3
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I71N8L

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=12e3119a87627741bd3871c895ce198f21529eb3



--------------------------------

commit f3dd0c53 upstream.

Commit 74e19ef0 ("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: 74e19ef0 ("uaccess: Add speculation barrier to copy_from_user()")
Reported-by: default avatarkernel test robot <lkp@intel.com>
Reported-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Reported-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
Tested-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Tested-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
Acked-by: default avatarAlexei Starovoitov <alexei.starovoitov@gmail.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>

Conflicts:
	kernel/bpf/core.c
Signed-off-by: default avatarMa Wupeng <mawupeng1@huawei.com>
Reviewed-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
Reviewed-by: default avatarNanyong Sun <sunnanyong@huawei.com>
Reviewed-by: default avatarXiu Jianfeng <xiujianfeng@huawei.com>
Signed-off-by: default avatarJialin Zhang <zhangjialin11@huawei.com>
parent 4e0f3c2f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment