summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2019-11-05 20:38:21 -0500
committerDavid S. Miller <davem@davemloft.net>2019-11-05 20:38:21 -0500
commit41de23e2232bbf8067cb1f6fe71a476046d9be88 (patch)
treecdc2c057c18e66169a374ce3533577bd68a86bc2 /tools/testing/selftests
parent0763b3e81a82477363d72548604455bf9468c2fa (diff)
parent7de086909365cd60a5619a45af3f4152516fd75c (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf
Daniel Borkmann says: ==================== pull-request: bpf 2019-11-02 The following pull-request contains BPF updates for your *net* tree. We've added 6 non-merge commits during the last 6 day(s) which contain a total of 8 files changed, 35 insertions(+), 9 deletions(-). The main changes are: 1) Fix ppc BPF JIT's tail call implementation by performing a second pass to gather a stable JIT context before opcode emission, from Eric Dumazet. 2) Fix build of BPF samples sys_perf_event_open() usage to compiled out unavailable test_attr__{enabled,open} checks. Also fix potential overflows in bpf_map_{area_alloc,charge_init} on 32 bit archs, from Björn Töpel. 3) Fix narrow loads of bpf_sysctl context fields with offset > 0 on big endian archs like s390x and also improve the test coverage, from Ilya Leoshkevich. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/testing/selftests')
-rw-r--r--tools/testing/selftests/bpf/test_sysctl.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/testing/selftests/bpf/test_sysctl.c b/tools/testing/selftests/bpf/test_sysctl.c
index a320e3844b17..7c6e5b173f33 100644
--- a/tools/testing/selftests/bpf/test_sysctl.c
+++ b/tools/testing/selftests/bpf/test_sysctl.c
@@ -161,9 +161,14 @@ static struct sysctl_test tests[] = {
161 .descr = "ctx:file_pos sysctl:read read ok narrow", 161 .descr = "ctx:file_pos sysctl:read read ok narrow",
162 .insns = { 162 .insns = {
163 /* If (file_pos == X) */ 163 /* If (file_pos == X) */
164#if __BYTE_ORDER == __LITTLE_ENDIAN
164 BPF_LDX_MEM(BPF_B, BPF_REG_7, BPF_REG_1, 165 BPF_LDX_MEM(BPF_B, BPF_REG_7, BPF_REG_1,
165 offsetof(struct bpf_sysctl, file_pos)), 166 offsetof(struct bpf_sysctl, file_pos)),
166 BPF_JMP_IMM(BPF_JNE, BPF_REG_7, 0, 2), 167#else
168 BPF_LDX_MEM(BPF_B, BPF_REG_7, BPF_REG_1,
169 offsetof(struct bpf_sysctl, file_pos) + 3),
170#endif
171 BPF_JMP_IMM(BPF_JNE, BPF_REG_7, 4, 2),
167 172
168 /* return ALLOW; */ 173 /* return ALLOW; */
169 BPF_MOV64_IMM(BPF_REG_0, 1), 174 BPF_MOV64_IMM(BPF_REG_0, 1),
@@ -176,6 +181,7 @@ static struct sysctl_test tests[] = {
176 .attach_type = BPF_CGROUP_SYSCTL, 181 .attach_type = BPF_CGROUP_SYSCTL,
177 .sysctl = "kernel/ostype", 182 .sysctl = "kernel/ostype",
178 .open_flags = O_RDONLY, 183 .open_flags = O_RDONLY,
184 .seek = 4,
179 .result = SUCCESS, 185 .result = SUCCESS,
180 }, 186 },
181 { 187 {