summaryrefslogtreecommitdiffstats
path: root/crypto/fips.c
diff options
context:
space:
mode:
authorJiong Wang <jiong.wang@netronome.com>2021-09-13 18:35:26 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-09-22 11:47:58 +0200
commit79aba0ac3df1a604e843780b17c37646e175b4f8 (patch)
tree6bb93840a59cc8141dcb8c06e46ce42ccbc56978 /crypto/fips.c
parent228e64bdbb1c5004a015bac942dd649f8ccab8c9 (diff)
downloadlinux-stable-79aba0ac3df1a604e843780b17c37646e175b4f8.tar.gz
linux-stable-79aba0ac3df1a604e843780b17c37646e175b4f8.tar.bz2
linux-stable-79aba0ac3df1a604e843780b17c37646e175b4f8.zip
bpf: correct slot_type marking logic to allow more stack slot sharing
commit 0bae2d4d62d523f06ff1a8e88ce38b45400acd28 upstream. Verifier is supposed to support sharing stack slot allocated to ptr with SCALAR_VALUE for privileged program. However this doesn't happen for some cases. The reason is verifier is not clearing slot_type STACK_SPILL for all bytes, it only clears part of them, while verifier is using: slot_type[0] == STACK_SPILL as a convention to check one slot is ptr type. So, the consequence of partial clearing slot_type is verifier could treat a partially overridden ptr slot, which should now be a SCALAR_VALUE slot, still as ptr slot, and rejects some valid programs. Before this patch, test_xdp_noinline.o under bpf selftests, bpf_lxc.o and bpf_netdev.o under Cilium bpf repo, when built with -mattr=+alu32 are rejected due to this issue. After this patch, they all accepted. There is no processed insn number change before and after this patch on Cilium bpf programs. Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: Jiong Wang <jiong.wang@netronome.com> Reviewed-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: Alexei Starovoitov <ast@kernel.org> [OP: adjusted context for 4.19] Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'crypto/fips.c')
0 files changed, 0 insertions, 0 deletions