]> git.karo-electronics.de Git - karo-tx-linux.git/commit
s390/bpf: reduce maximum program size to 64 KB
authorMichael Holzheu <holzheu@linux.vnet.ibm.com>
Thu, 12 May 2016 16:10:48 +0000 (18:10 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 24 Jun 2016 17:18:19 +0000 (10:18 -0700)
commit9be2fa205c9e1337a68847ae38e791bd6b17cc42
tree1c4e514f398e285466b32d5648a201992ca602c0
parentebf529182a6da5fcbecf0305b19de4e0cba048fb
s390/bpf: reduce maximum program size to 64 KB

commit 0fa963553a5c28d8f8aabd8878326d3f782045fc upstream.

The s390 BFP compiler currently uses relative branch instructions
that only support jumps up to 64 KB. Examples are "j", "jnz", "cgrj",
etc.  Currently the maximum size of s390 BPF programs is set
to 0x7ffff.  If branches over 64 KB are generated the, kernel can
crash due to incorrect code.

So fix this an reduce the maximum size to 64 KB. Programs larger than
that will be interpreted.

Fixes: ce2b6ad9c185 ("s390/bpf: increase BPF_SIZE_MAX")
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/s390/net/bpf_jit_comp.c