Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary Lin <glin@suse.com>2019-11-06 17:49:33 +0800
committerGary Lin <glin@suse.com>2019-11-06 17:49:38 +0800
commit86c4b30f999a99bbe906b11a78f439d10a33ef6c (patch)
tree622f5ae64b15ec9c9128c98af1283a50f9fbdb28
parented6737da598d568823bb5915f4f7b659288139da (diff)
selftests/bpf: fix "ctx:write sysctl:write read ok" on s390
(bsc#1155518).
-rw-r--r--patches.suse/selftests-bpf-fix-ctx-write-sysctl-write-read-ok-on-.patch32
-rw-r--r--series.conf1
2 files changed, 33 insertions, 0 deletions
diff --git a/patches.suse/selftests-bpf-fix-ctx-write-sysctl-write-read-ok-on-.patch b/patches.suse/selftests-bpf-fix-ctx-write-sysctl-write-read-ok-on-.patch
new file mode 100644
index 0000000000..bb1328a1b1
--- /dev/null
+++ b/patches.suse/selftests-bpf-fix-ctx-write-sysctl-write-read-ok-on-.patch
@@ -0,0 +1,32 @@
+From: Ilya Leoshkevich <iii@linux.ibm.com>
+Date: Fri, 30 Aug 2019 13:07:30 +0200
+Subject: selftests/bpf: fix "ctx:write sysctl:write read ok" on s390
+Patch-mainline: v5.4-rc1
+Git-commit: 3404ddf234ba4677bf224cb15ddcdea0ceab956e
+References: bsc#1155518
+
+"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>
+Acked-by: Gary Lin <glin@suse.com>
+---
+ tools/testing/selftests/bpf/test_sysctl.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- 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[] = {
+ .descr = "ctx:write sysctl:write read ok",
+ .insns = {
+ /* If (write) */
+- BPF_LDX_MEM(BPF_B, BPF_REG_7, BPF_REG_1,
++ BPF_LDX_MEM(BPF_W, BPF_REG_7, BPF_REG_1,
+ offsetof(struct bpf_sysctl, write)),
+ BPF_JMP_IMM(BPF_JNE, BPF_REG_7, 1, 2),
+
diff --git a/series.conf b/series.conf
index 177ecb3e9f..58a22cfdfa 100644
--- a/series.conf
+++ b/series.conf
@@ -1136,6 +1136,7 @@
patches.suse/net-mlx5e-Allow-XSK-frames-smaller-than-a-page.patch
patches.suse/libbpf-add-flags-to-umem-config.patch
patches.suse/selftests-bpf-introduce-bpf_cpu_to_be64-and-bpf_be64.patch
+ patches.suse/selftests-bpf-fix-ctx-write-sysctl-write-read-ok-on-.patch
patches.suse/i40e-fix-xdp-handle-calculations.patch
patches.suse/ixgbe-fix-xdp-handle-calculations.patch
patches.suse/xsk-avoid-store-tearing-when-assigning-queues.patch