From: Eric Dumazet Date: Fri, 17 May 2013 16:37:03 +0000 (+0000) Subject: x86: bpf_jit_comp: secure bpf jit against spraying attacks X-Git-Tag: v3.11-rc1~16^2~382 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=314beb9bcabfd6b4542ccbced2402af2c6f6142a;p=pandora-kernel.git x86: bpf_jit_comp: secure bpf jit against spraying attacks hpa bringed into my attention some security related issues with BPF JIT on x86. This patch makes sure the bpf generated code is marked read only, as other kernel text sections. It also splits the unused space (we vmalloc() and only use a fraction of the page) in two parts, so that the generated bpf code not starts at a known offset in the page, but a pseudo random one. Refs: http://mainisusuallyafunction.blogspot.com/2012/11/attacking-hardened-linux-systems-with.html Reported-by: H. Peter Anvin Signed-off-by: Eric Dumazet Reviewed-by: Daniel Borkmann Signed-off-by: David S. Miller --- Reading git-diff-tree failed