]> granicus.if.org Git - strace/commitdiff
tests: check decoding of bpf_attr of size 1
authorDmitry V. Levin <ldv@altlinux.org>
Tue, 3 Apr 2018 08:08:09 +0000 (08:08 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Wed, 4 Apr 2018 16:33:19 +0000 (16:33 +0000)
* tests/bpf.c (BPF_PROG_GET_NEXT_ID_checks): New entry.

tests/bpf.c

index 4b3a11d2d9d01be6e90f5c214094e6c1cddb9910..a3b7994220a1340c31bd8d06bd04051bcb3d1e55 100644 (file)
@@ -498,6 +498,19 @@ static const struct bpf_attr_check BPF_PROG_GET_NEXT_ID_checks[] = {
                .size = offsetofend(struct BPF_PROG_GET_NEXT_ID_struct, start_id),
                .str = "start_id=3735928559, next_id=0"
        },
+       {
+               .data = { .BPF_PROG_GET_NEXT_ID_data = {
+                       .start_id = 0xdeadbeef
+               } },
+               .size = 1,
+               .str = "start_id="
+#if WORDS_BIGENDIAN
+                      "3724541952"     /* 0xde000000 */
+#else
+                      "239"            /* 0x000000ef */
+#endif
+                      ", next_id=0"
+       },
        {
                .data = { .BPF_PROG_GET_NEXT_ID_data = {
                        .start_id = 0xbadc0ded,