summaryrefslogtreecommitdiff
path: root/arch/s390/net
diff options
context:
space:
mode:
authorMichael Holzheu <holzheu@linux.vnet.ibm.com>2015-01-08 13:46:18 (GMT)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2015-01-09 09:10:32 (GMT)
commitae750974591bb9431b1f84b1323dc2fb7d8fe360 (patch)
tree4011215959e287ebd82bedc3141f312cfbf55c37 /arch/s390/net
parentdf3eed3d282f2fe1ffb73d3545fcde4e9b80a0d3 (diff)
downloadlinux-ae750974591bb9431b1f84b1323dc2fb7d8fe360.tar.xz
s390/bpf: Fix JMP_JGE_X (A > X) and JMP_JGT_X (A >= X)
Currently the signed COMPARE (cr) instruction is used to compare "A" with "X". This is not correct because "A" and "X" are both unsigned. To fix this use the unsigned COMPARE LOGICAL (clr) instruction instead. Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/net')
-rw-r--r--arch/s390/net/bpf_jit_comp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c
index 8bc474f..524496d 100644
--- a/arch/s390/net/bpf_jit_comp.c
+++ b/arch/s390/net/bpf_jit_comp.c
@@ -502,8 +502,8 @@ branch: if (filter->jt == filter->jf) {
xbranch: /* Emit compare if the branch targets are different */
if (filter->jt != filter->jf) {
jit->seen |= SEEN_XREG;
- /* cr %r5,%r12 */
- EMIT2(0x195c);
+ /* clr %r5,%r12 */
+ EMIT2(0x155c);
}
goto branch;
case BPF_JMP | BPF_JSET | BPF_X: /* ip += (A & X) ? jt : jf */