]> git.baikalelectronics.ru Git - kernel.git/commit
ARM: net fix emit_udiv() for BPF_ALU | BPF_DIV | BPF_K intruction.
authorNicolas Schichan <nschichan@freebox.fr>
Wed, 6 May 2015 16:31:56 +0000 (18:31 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 10 May 2015 23:20:32 +0000 (19:20 -0400)
commit58489be5720088a9b09592b4757ea26f57fc0c15
tree5a26d0599eb1e57364f82e3aa200458a1933a19a
parent5f50bd506167d1a17eadf9e1ba5618b70423e92c
ARM: net fix emit_udiv() for BPF_ALU | BPF_DIV | BPF_K intruction.

In that case, emit_udiv() will be called with rn == ARM_R0 (r_scratch)
and loading rm first into ARM_R0 will result in jit_udiv() function
being called the same dividend and divisor. Fix that by loading rn
first into ARM_R1 and then rm into ARM_R0.

Signed-off-by: Nicolas Schichan <nschichan@freebox.fr>
Cc: <stable@vger.kernel.org> # v3.13+
Fixes: f544c7d57649 (bpf: do not use reciprocal divide)
Acked-by: Mircea Gherzan <mgherzan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
arch/arm/net/bpf_jit_32.c