linux/include
Daniel Borkmann 7b5b73ea87 bpf: fix branch pruning logic
From: Alexei Starovoitov <ast@fb.com>

[ Upstream commit c131187db2 ]

when the verifier detects that register contains a runtime constant
and it's compared with another constant it will prune exploration
of the branch that is guaranteed not to be taken at runtime.
This is all correct, but malicious program may be constructed
in such a way that it always has a constant comparison and
the other branch is never taken under any conditions.
In this case such path through the program will not be explored
by the verifier. It won't be taken at run-time either, but since
all instructions are JITed the malicious program may cause JITs
to complain about using reserved fields, etc.
To fix the issue we have to track the instructions explored by
the verifier and sanitize instructions that are dead at run time
with NOPs. We cannot reject such dead code, since llvm generates
it for valid C code, since it doesn't do as much data flow
analysis as the verifier does.

Fixes: 17a5267067 ("bpf: verifier (add verifier core)")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2017-12-25 14:23:47 +01:00
..
acpi ACPICA: Linuxize: Restore and fix Intel compiler build 2017-02-26 11:10:52 +01:00
asm-generic percpu: make this_cpu_generic_read() atomic w.r.t. interrupts 2017-10-12 11:51:23 +02:00
clocksource clocksource/drivers/sp804: Convert init function to return error 2016-06-28 10:19:30 +02:00
crypto crypto: hmac - require that the underlying hash algorithm is unkeyed 2017-12-20 10:07:15 +01:00
drm drm: Don't race connector registration 2017-06-17 06:41:53 +02:00
dt-bindings ARM: dts: Fix omap3 off mode pull defines 2017-11-21 09:23:22 +01:00
keys KEYS: Strip trailing spaces 2016-06-14 10:29:44 +01:00
kvm ARM: KVM: Support vgic-v3 2016-09-22 13:22:21 +02:00
linux bpf: fix branch pruning logic 2017-12-25 14:23:47 +01:00
math-emu math-emu: fix floating-point to integer overflow detection 2014-01-07 18:36:24 -06:00
media Linux 4.8 2016-10-05 16:43:53 -03:00
memory ddr: add LPDDR2 data from JESD209-2 2012-05-02 00:04:06 -07:00
misc cxl: Add cxl_check_and_switch_mode() API to switch bi-modal cards 2016-07-14 20:28:11 +10:00
net vhost-vsock: add pkt cancel capability 2017-12-25 14:23:37 +01:00
pcmcia pcmcia/ds.h: introduce helper for pcmcia_driver module boilerplate 2013-03-15 12:26:03 -07:00
ras tracing, RAS: Cleanup on __get_str() usage 2016-07-15 15:51:16 -04:00
rdma IB/core: Fix calculation of maximum RoCE MTU 2017-12-20 10:07:32 +01:00
rxrpc rxrpc: Add tracepoint for ACK proposal 2016-09-23 15:49:19 +01:00
scsi scsi: libsas: align sata_device's rps_resp on a cacheline 2017-12-14 09:28:11 +01:00
soc ARM: at91: define LPDDR types 2017-03-12 06:41:41 +01:00
sound ALSA: seq: Avoid invalid lockdep class warning 2017-11-15 15:53:18 +01:00
target target: fix ALUA transition timeout handling 2017-12-20 10:07:26 +01:00
trace SUNRPC: Fix tracepoint storage issues with svc_recv and svc_rqst_status 2017-11-30 08:39:07 +00:00
uapi usb: add helper to extract bits 12:11 of wMaxPacketSize 2017-12-20 10:07:16 +01:00
video fbdev changes for 4.9 2016-10-12 11:01:37 -07:00
xen swiotlb-xen: implement xen_swiotlb_dma_mmap callback 2017-10-05 09:44:05 +02:00
Kbuild UAPI: remove empty Kbuild files 2013-04-30 17:04:09 -07:00