Go to file
Yonghong Song a115d0ed72 bpf: set inner_map_meta->spin_lock_off correctly
Commit d83525ca62 ("bpf: introduce bpf_spin_lock")
introduced bpf_spin_lock and the field spin_lock_off
in kernel internal structure bpf_map has the following
meaning:
  >=0 valid offset, <0 error

For every map created, the kernel will ensure
spin_lock_off has correct value.

Currently, bpf_map->spin_lock_off is not copied
from the inner map to the map_in_map inner_map_meta
during a map_in_map type map creation, so
inner_map_meta->spin_lock_off = 0.
This will give verifier wrong information that
inner_map has bpf_spin_lock and the bpf_spin_lock
is defined at offset 0. An access to offset 0
of a value pointer will trigger the following error:
   bpf_spin_lock cannot be accessed directly by load/store

This patch fixed the issue by copy inner map's spin_lock_off
value to inner_map_meta->spin_lock_off.

Fixes: d83525ca62 ("bpf: introduce bpf_spin_lock")
Signed-off-by: Yonghong Song <yhs@fb.com>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2019-02-27 17:03:13 -08:00
arch
block
certs
crypto
Documentation xsk: add FAQ to facilitate for first time users 2019-02-25 23:21:42 +01:00
drivers bnx2x: Remove set but not used variable 'mfw_vn' 2019-02-18 16:47:32 -08:00
firmware
fs
include bpf: expose program stats via bpf_prog_info 2019-02-27 17:22:50 +01:00
init
ipc
kernel bpf: set inner_map_meta->spin_lock_off correctly 2019-02-27 17:03:13 -08:00
lib bpf: test_bpf: turn off preemption in function __run_once 2019-02-25 22:18:07 +01:00
LICENSES
mm
net bpf/test_run: fix unkillable BPF_PROG_TEST_RUN for flow dissector 2019-02-25 22:21:22 +01:00
samples samples: bpf: fix: broken sample regarding removed function 2019-02-27 17:27:22 +01:00
scripts
security
sound
tools tools/bpftool: recognize bpf_prog_info run_time_ns and run_cnt 2019-02-27 17:22:51 +01:00
usr
virt
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.