android_kernel_google_msm/arch
Alexei Starovoitov 67ba9818b3 x86: bpf_jit: fix compilation of large bpf programs
commit 3f7352bf21f8fd7ba3e2fcef9488756f188e12be upstream.

x86 has variable length encoding. x86 JIT compiler is trying
to pick the shortest encoding for given bpf instruction.
While doing so the jump targets are changing, so JIT is doing
multiple passes over the program. Typical program needs 3 passes.
Some very short programs converge with 2 passes. Large programs
may need 4 or 5. But specially crafted bpf programs may hit the
pass limit and if the program converges on the last iteration
the JIT compiler will be producing an image full of 'int 3' insns.
Fix this corner case by doing final iteration over bpf program.

Fixes: 0a14842f5a ("net: filter: Just In Time compiler for x86-64")
Reported-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
Tested-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
[lizf: Backported to 3.4: adjust context]
Signed-off-by: Zefan Li <lizefan@huawei.com>
2015-09-18 09:20:42 +08:00
..
alpha PCI: Convert pcibios_resource_to_bus() to take a pci_bus, not a pci_dev 2015-06-19 11:40:34 +08:00
arm ARM: dts: imx27: only map 4 Kbyte for fec registers 2015-09-18 09:20:42 +08:00
avr32 vm: add VM_FAULT_SIGSEGV handling support 2015-04-14 17:33:57 +08:00
blackfin
c6x C6x: time: Ensure consistency in __init 2015-09-18 09:20:25 +08:00
cris vm: add VM_FAULT_SIGSEGV handling support 2015-04-14 17:33:57 +08:00
frv vm: add VM_FAULT_SIGSEGV handling support 2015-04-14 17:33:57 +08:00
h8300 signal: Define __ARCH_HAS_SA_RESTORER so we know whether to clear sa_restorer 2013-04-05 10:04:14 -07:00
hexagon
ia64 vm: add VM_FAULT_SIGSEGV handling support 2015-04-14 17:33:57 +08:00
m32r vm: add VM_FAULT_SIGSEGV handling support 2015-04-14 17:33:57 +08:00
m68k vm: add VM_FAULT_SIGSEGV handling support 2015-04-14 17:33:57 +08:00
microblaze vm: add VM_FAULT_SIGSEGV handling support 2015-04-14 17:33:57 +08:00
mips MIPS: Hibernate: flush TLB entries earlier 2015-09-18 09:20:28 +08:00
mn10300 vm: add VM_FAULT_SIGSEGV handling support 2015-04-14 17:33:57 +08:00
openrisc vm: add VM_FAULT_SIGSEGV handling support 2015-04-14 17:33:57 +08:00
parisc vm: add VM_FAULT_SIGSEGV handling support 2015-04-14 17:33:57 +08:00
powerpc powerpc: Align TOC to 256 bytes 2015-09-18 09:20:41 +08:00
s390 crypto: s390/ghash - Fix incorrect ghash icv buffer handling. 2015-09-18 09:20:42 +08:00
score vm: add VM_FAULT_SIGSEGV handling support 2015-04-14 17:33:57 +08:00
sh vm: add VM_FAULT_SIGSEGV handling support 2015-04-14 17:33:57 +08:00
sparc PCI: Convert pcibios_resource_to_bus() to take a pci_bus, not a pci_dev 2015-06-19 11:40:34 +08:00
tile vm: add VM_FAULT_SIGSEGV handling support 2015-04-14 17:33:57 +08:00
um vm: add VM_FAULT_SIGSEGV handling support 2015-04-14 17:33:57 +08:00
unicore32 UniCore32-bugfix: fix mismatch return value of __xchg_bad_pointer 2014-09-25 11:49:18 +08:00
x86 x86: bpf_jit: fix compilation of large bpf programs 2015-09-18 09:20:42 +08:00
xtensa vm: add VM_FAULT_SIGSEGV handling support 2015-04-14 17:33:57 +08:00
.gitignore
Kconfig