diff options
| author | Ilya Leoshkevich <[email protected]> | 2020-07-17 16:53:23 +0000 |
|---|---|---|
| committer | Alexei Starovoitov <[email protected]> | 2020-07-21 20:26:24 +0000 |
| commit | 7477d43be5b1448bc0d4c85cb185a0144cc080e1 (patch) | |
| tree | b793d3f549d3590bd3df11bd09d276c22c94c62c /tools/lib/bpf/bpf_helpers.h | |
| parent | selftests: bpf: test_kmod.sh: Fix running out of srctree (diff) | |
| download | kernel-7477d43be5b1448bc0d4c85cb185a0144cc080e1.tar.gz kernel-7477d43be5b1448bc0d4c85cb185a0144cc080e1.zip | |
s390/bpf: Fix sign extension in branch_ku
Both signed and unsigned variants of BPF_JMP | BPF_K require
sign-extending the immediate. JIT emits cgfi for the signed case,
which is correct, and clgfi for the unsigned case, which is not
correct: clgfi zero-extends the immediate.
s390 does not provide an instruction that does sign-extension and
unsigned comparison at the same time. Therefore, fix by first loading
the sign-extended immediate into work register REG_1 and proceeding
as if it's BPF_X.
Fixes: 4e9b4a6883dd ("s390/bpf: Use relative long branches")
Reported-by: Seth Forshee <[email protected]>
Signed-off-by: Ilya Leoshkevich <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Tested-by: Seth Forshee <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/lib/bpf/bpf_helpers.h')
0 files changed, 0 insertions, 0 deletions
