ARM: net: bpf: fix register saving
authorRussell King <rmk+kernel@armlinux.org.uk>
Sat, 13 Jan 2018 22:38:18 +0000 (22:38 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Jan 2018 13:03:43 +0000 (14:03 +0100)
commit0da4a4d0c7f941638e2e7e515c2d758de8976418
treef2beff17fad0db82b01c5b5a3a939ee94d78e8c2
parent295bcfbbcf5a741e9103605c3252276ed21433bb
ARM: net: bpf: fix register saving

commit 02088d9b392f605c892894b46aa8c83e3abd0115 upstream.

When an eBPF program tail-calls another eBPF program, it enters it after
the prologue to avoid having complex stack manipulations.  This can lead
to kernel oopses, and similar.

Resolve this by always using a fixed stack layout, a CPU register frame
pointer, and using this when reloading registers before returning.

Fixes: 39c13c204bb1 ("arm: eBPF JIT compiler")
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/net/bpf_jit_32.c