diff options
author | Ilya Leoshkevich <iii@linux.ibm.com> | 2019-08-30 07:07:30 -0400 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2019-09-03 15:01:52 -0400 |
commit | 3404ddf234ba4677bf224cb15ddcdea0ceab956e (patch) | |
tree | 7dde5f4430846f68a01a48440d0e63f9ae56fa3f /tools | |
parent | b9632679944307f3caab183fa69a4d79ffeb40ce (diff) |
selftests/bpf: fix "ctx:write sysctl:write read ok" on s390
"ctx:write sysctl:write read ok" fails on s390 because it reads the
first byte of an int assuming it's the least-significant one, which
is not the case on big-endian arches. Since we are not testing narrow
accesses here (there is e.g. "ctx:file_pos sysctl:read read ok narrow"
for that), simply read the whole int.
Fixes: 1f5fa9ab6e2e ("selftests/bpf: Test BPF_CGROUP_SYSCTL")
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/testing/selftests/bpf/test_sysctl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/bpf/test_sysctl.c b/tools/testing/selftests/bpf/test_sysctl.c index a3bebd7c68dd..908f327839d5 100644 --- a/tools/testing/selftests/bpf/test_sysctl.c +++ b/tools/testing/selftests/bpf/test_sysctl.c | |||
@@ -100,7 +100,7 @@ static struct sysctl_test tests[] = { | |||
100 | .descr = "ctx:write sysctl:write read ok", | 100 | .descr = "ctx:write sysctl:write read ok", |
101 | .insns = { | 101 | .insns = { |
102 | /* If (write) */ | 102 | /* If (write) */ |
103 | BPF_LDX_MEM(BPF_B, BPF_REG_7, BPF_REG_1, | 103 | BPF_LDX_MEM(BPF_W, BPF_REG_7, BPF_REG_1, |
104 | offsetof(struct bpf_sysctl, write)), | 104 | offsetof(struct bpf_sysctl, write)), |
105 | BPF_JMP_IMM(BPF_JNE, BPF_REG_7, 1, 2), | 105 | BPF_JMP_IMM(BPF_JNE, BPF_REG_7, 1, 2), |
106 | 106 | ||