]> git.baikalelectronics.ru Git - kernel.git/commit
s390/bpf: clear correct BPF accumulator register
authorMichael Holzheu <holzheu@linux.vnet.ibm.com>
Wed, 29 Jul 2015 19:15:14 +0000 (21:15 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 29 Jul 2015 21:59:58 +0000 (14:59 -0700)
commitdd96164b9c8464a6a068404c76c5565e3a0c7b94
tree07a4e6f7b67771d69bc7e67020efe734465a6293
parentefc98cf16888620795671345d734a1b360b635e7
s390/bpf: clear correct BPF accumulator register

Currently we assumed the following BPF to eBPF register mapping:

 - BPF_REG_A -> BPF_REG_7
 - BPF_REG_X -> BPF_REG_8

Unfortunately this mapping is wrong. The correct mapping is:

 - BPF_REG_A -> BPF_REG_0
 - BPF_REG_X -> BPF_REG_7

So clear the correct registers and use the BPF_REG_A and BPF_REG_X
macros instead of BPF_REG_0/7.

Fixes: 9f7ede77bdb9 ("s390/bpf: Add s390x eBPF JIT compiler backend")
Cc: stable@vger.kernel.org # 4.0+
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
arch/s390/net/bpf_jit_comp.c