summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2019-10-14 09:07:03 -0600
committerJens Axboe <axboe@kernel.dk>2019-10-14 09:07:03 -0600
commit19ca53282d86edd42261076c4a7433fbd5dc1e20 (patch)
tree02813f5f6388af8d73a9b76df7ede9f0e97c2a44
parent24bd08736590ef541708ad258086fac9b7573cc3 (diff)
downloadliburing-19ca53282d86edd42261076c4a7433fbd5dc1e20.tar.gz
liburing-19ca53282d86edd42261076c4a7433fbd5dc1e20.tar.bz2
Add test case for skb/socket ref count issues with fully sparse file set
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--test/Makefile5
-rw-r--r--test/a0908ae19763-test.c59
2 files changed, 62 insertions, 2 deletions
diff --git a/test/Makefile b/test/Makefile
index 13f0346..3ab5f81 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -7,7 +7,7 @@ all_targets += poll poll-cancel ring-leak fsync io_uring_setup io_uring_register
917257daa0fe-test b19062a56726-test eeed8b54e0df-test link \
send_recvmsg a4c0b3decb33-test 500f9fbadef8-test timeout \
sq-space_left stdout cq-ready cq-peek-batch file-register \
- cq-size 8a9973408177-test
+ cq-size 8a9973408177-test a0908ae19763-test
include ../Makefile.quiet
@@ -21,7 +21,8 @@ test_srcs := poll.c poll-cancel.c ring-leak.c fsync.c io_uring_setup.c \
35fa71a030ca-test.c 917257daa0fe-test.c b19062a56726-test.c \
eeed8b54e0df-test.c link.c send_recvmsg.c a4c0b3decb33-test.c \
500f9fbadef8-test.c timeout.c sq-space_left.c stdout.c cq-ready.c\
- cq-peek-batch.c file-register.c cq-size.c 8a9973408177-test.c
+ cq-peek-batch.c file-register.c cq-size.c 8a9973408177-test.c \
+ a0908ae19763-test.c
test_objs := $(patsubst %.c,%.ol,$(test_srcs))
diff --git a/test/a0908ae19763-test.c b/test/a0908ae19763-test.c
new file mode 100644
index 0000000..cacd70c
--- /dev/null
+++ b/test/a0908ae19763-test.c
@@ -0,0 +1,59 @@
+// autogenerated by syzkaller (https://github.com/google/syzkaller)
+
+#include <endian.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/syscall.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#ifndef __NR_io_uring_register
+#define __NR_io_uring_register 427
+#endif
+#ifndef __NR_io_uring_setup
+#define __NR_io_uring_setup 425
+#endif
+
+uint64_t r[1] = {0xffffffffffffffff};
+
+int main(void)
+{
+ syscall(__NR_mmap, 0x20000000, 0x1000000, 3, 0x32, -1, 0);
+ intptr_t res = 0;
+ *(uint32_t*)0x20000080 = 0;
+ *(uint32_t*)0x20000084 = 0;
+ *(uint32_t*)0x20000088 = 0;
+ *(uint32_t*)0x2000008c = 0;
+ *(uint32_t*)0x20000090 = 0;
+ *(uint32_t*)0x20000094 = 0;
+ *(uint32_t*)0x20000098 = 0;
+ *(uint32_t*)0x2000009c = 0;
+ *(uint32_t*)0x200000a0 = 0;
+ *(uint32_t*)0x200000a4 = 0;
+ *(uint32_t*)0x200000a8 = 0;
+ *(uint32_t*)0x200000ac = 0;
+ *(uint32_t*)0x200000b0 = 0;
+ *(uint32_t*)0x200000b4 = 0;
+ *(uint32_t*)0x200000b8 = 0;
+ *(uint32_t*)0x200000bc = 0;
+ *(uint32_t*)0x200000c0 = 0;
+ *(uint32_t*)0x200000c4 = 0;
+ *(uint64_t*)0x200000c8 = 0;
+ *(uint32_t*)0x200000d0 = 0;
+ *(uint32_t*)0x200000d4 = 0;
+ *(uint32_t*)0x200000d8 = 0;
+ *(uint32_t*)0x200000dc = 0;
+ *(uint32_t*)0x200000e0 = 0;
+ *(uint32_t*)0x200000e4 = 0;
+ *(uint32_t*)0x200000e8 = 0;
+ *(uint32_t*)0x200000ec = 0;
+ *(uint64_t*)0x200000f0 = 0;
+ res = syscall(__NR_io_uring_setup, 0xa4, 0x20000080);
+ if (res != -1)
+ r[0] = res;
+ *(uint32_t*)0x20000280 = -1;
+ syscall(__NR_io_uring_register, r[0], 2, 0x20000280, 1);
+ return 0;
+}