@nxtedition/rocksdb 5.2.36 → 5.2.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (190) hide show
  1. package/binding.cc +66 -91
  2. package/deps/liburing/liburing/COPYING +502 -0
  3. package/deps/liburing/liburing/COPYING.GPL +339 -0
  4. package/deps/liburing/liburing/LICENSE +7 -0
  5. package/deps/liburing/liburing/Makefile +84 -0
  6. package/deps/liburing/liburing/Makefile.quiet +11 -0
  7. package/deps/liburing/liburing/README +46 -0
  8. package/deps/liburing/liburing/configure +420 -0
  9. package/deps/liburing/liburing/debian/README.Debian +7 -0
  10. package/deps/liburing/liburing/debian/changelog +27 -0
  11. package/deps/liburing/liburing/debian/compat +1 -0
  12. package/deps/liburing/liburing/debian/control +48 -0
  13. package/deps/liburing/liburing/debian/copyright +49 -0
  14. package/deps/liburing/liburing/debian/liburing-dev.install +4 -0
  15. package/deps/liburing/liburing/debian/liburing-dev.manpages +6 -0
  16. package/deps/liburing/liburing/debian/liburing1-udeb.install +1 -0
  17. package/deps/liburing/liburing/debian/liburing1.install +1 -0
  18. package/deps/liburing/liburing/debian/liburing1.symbols +32 -0
  19. package/deps/liburing/liburing/debian/patches/series +1 -0
  20. package/deps/liburing/liburing/debian/rules +81 -0
  21. package/deps/liburing/liburing/debian/source/format +1 -0
  22. package/deps/liburing/liburing/debian/source/local-options +2 -0
  23. package/deps/liburing/liburing/debian/source/options +1 -0
  24. package/deps/liburing/liburing/debian/watch +3 -0
  25. package/deps/liburing/liburing/examples/Makefile +29 -0
  26. package/deps/liburing/liburing/examples/io_uring-cp.c +279 -0
  27. package/deps/liburing/liburing/examples/io_uring-test.c +112 -0
  28. package/deps/liburing/liburing/examples/link-cp.c +193 -0
  29. package/deps/liburing/liburing/examples/ucontext-cp.c +273 -0
  30. package/deps/liburing/liburing/liburing.pc.in +12 -0
  31. package/deps/liburing/liburing/liburing.spec +66 -0
  32. package/deps/liburing/liburing/make-debs.sh +53 -0
  33. package/deps/liburing/liburing/man/io_uring.7 +736 -0
  34. package/deps/liburing/liburing/man/io_uring_enter.2 +1403 -0
  35. package/deps/liburing/liburing/man/io_uring_get_sqe.3 +37 -0
  36. package/deps/liburing/liburing/man/io_uring_queue_exit.3 +27 -0
  37. package/deps/liburing/liburing/man/io_uring_queue_init.3 +44 -0
  38. package/deps/liburing/liburing/man/io_uring_register.2 +605 -0
  39. package/deps/liburing/liburing/man/io_uring_setup.2 +515 -0
  40. package/deps/liburing/liburing/src/Makefile +76 -0
  41. package/deps/liburing/liburing/src/include/liburing/barrier.h +73 -0
  42. package/deps/liburing/liburing/src/include/liburing/io_uring.h +422 -0
  43. package/deps/liburing/liburing/src/include/liburing.h +775 -0
  44. package/deps/liburing/liburing/src/liburing.map +46 -0
  45. package/deps/liburing/liburing/src/queue.c +403 -0
  46. package/deps/liburing/liburing/src/register.c +299 -0
  47. package/deps/liburing/liburing/src/setup.c +356 -0
  48. package/deps/liburing/liburing/src/syscall.c +73 -0
  49. package/deps/liburing/liburing/src/syscall.h +20 -0
  50. package/deps/liburing/liburing/test/232c93d07b74-test.c +305 -0
  51. package/deps/liburing/liburing/test/35fa71a030ca-test.c +329 -0
  52. package/deps/liburing/liburing/test/500f9fbadef8-test.c +89 -0
  53. package/deps/liburing/liburing/test/7ad0e4b2f83c-test.c +93 -0
  54. package/deps/liburing/liburing/test/8a9973408177-test.c +106 -0
  55. package/deps/liburing/liburing/test/917257daa0fe-test.c +53 -0
  56. package/deps/liburing/liburing/test/Makefile +312 -0
  57. package/deps/liburing/liburing/test/a0908ae19763-test.c +58 -0
  58. package/deps/liburing/liburing/test/a4c0b3decb33-test.c +180 -0
  59. package/deps/liburing/liburing/test/accept-link.c +251 -0
  60. package/deps/liburing/liburing/test/accept-reuse.c +164 -0
  61. package/deps/liburing/liburing/test/accept-test.c +79 -0
  62. package/deps/liburing/liburing/test/accept.c +476 -0
  63. package/deps/liburing/liburing/test/across-fork.c +283 -0
  64. package/deps/liburing/liburing/test/b19062a56726-test.c +53 -0
  65. package/deps/liburing/liburing/test/b5837bd5311d-test.c +77 -0
  66. package/deps/liburing/liburing/test/ce593a6c480a-test.c +135 -0
  67. package/deps/liburing/liburing/test/close-opath.c +122 -0
  68. package/deps/liburing/liburing/test/config +10 -0
  69. package/deps/liburing/liburing/test/connect.c +398 -0
  70. package/deps/liburing/liburing/test/cq-full.c +96 -0
  71. package/deps/liburing/liburing/test/cq-overflow.c +294 -0
  72. package/deps/liburing/liburing/test/cq-peek-batch.c +102 -0
  73. package/deps/liburing/liburing/test/cq-ready.c +94 -0
  74. package/deps/liburing/liburing/test/cq-size.c +58 -0
  75. package/deps/liburing/liburing/test/d4ae271dfaae-test.c +96 -0
  76. package/deps/liburing/liburing/test/d77a67ed5f27-test.c +65 -0
  77. package/deps/liburing/liburing/test/defer.c +307 -0
  78. package/deps/liburing/liburing/test/double-poll-crash.c +186 -0
  79. package/deps/liburing/liburing/test/eeed8b54e0df-test.c +114 -0
  80. package/deps/liburing/liburing/test/empty-eownerdead.c +42 -0
  81. package/deps/liburing/liburing/test/eventfd-disable.c +151 -0
  82. package/deps/liburing/liburing/test/eventfd-ring.c +97 -0
  83. package/deps/liburing/liburing/test/eventfd.c +112 -0
  84. package/deps/liburing/liburing/test/fadvise.c +202 -0
  85. package/deps/liburing/liburing/test/fallocate.c +249 -0
  86. package/deps/liburing/liburing/test/fc2a85cb02ef-test.c +138 -0
  87. package/deps/liburing/liburing/test/file-register.c +843 -0
  88. package/deps/liburing/liburing/test/file-update.c +173 -0
  89. package/deps/liburing/liburing/test/files-exit-hang-poll.c +128 -0
  90. package/deps/liburing/liburing/test/files-exit-hang-timeout.c +134 -0
  91. package/deps/liburing/liburing/test/fixed-link.c +90 -0
  92. package/deps/liburing/liburing/test/fsync.c +224 -0
  93. package/deps/liburing/liburing/test/hardlink.c +136 -0
  94. package/deps/liburing/liburing/test/helpers.c +135 -0
  95. package/deps/liburing/liburing/test/helpers.h +67 -0
  96. package/deps/liburing/liburing/test/io-cancel.c +537 -0
  97. package/deps/liburing/liburing/test/io_uring_enter.c +296 -0
  98. package/deps/liburing/liburing/test/io_uring_register.c +664 -0
  99. package/deps/liburing/liburing/test/io_uring_setup.c +192 -0
  100. package/deps/liburing/liburing/test/iopoll.c +366 -0
  101. package/deps/liburing/liburing/test/lfs-openat-write.c +117 -0
  102. package/deps/liburing/liburing/test/lfs-openat.c +273 -0
  103. package/deps/liburing/liburing/test/link-timeout.c +1107 -0
  104. package/deps/liburing/liburing/test/link.c +496 -0
  105. package/deps/liburing/liburing/test/link_drain.c +229 -0
  106. package/deps/liburing/liburing/test/madvise.c +195 -0
  107. package/deps/liburing/liburing/test/mkdir.c +108 -0
  108. package/deps/liburing/liburing/test/multicqes_drain.c +383 -0
  109. package/deps/liburing/liburing/test/nop-all-sizes.c +107 -0
  110. package/deps/liburing/liburing/test/nop.c +115 -0
  111. package/deps/liburing/liburing/test/open-close.c +146 -0
  112. package/deps/liburing/liburing/test/openat2.c +240 -0
  113. package/deps/liburing/liburing/test/personality.c +204 -0
  114. package/deps/liburing/liburing/test/pipe-eof.c +81 -0
  115. package/deps/liburing/liburing/test/pipe-reuse.c +105 -0
  116. package/deps/liburing/liburing/test/poll-cancel-ton.c +139 -0
  117. package/deps/liburing/liburing/test/poll-cancel.c +135 -0
  118. package/deps/liburing/liburing/test/poll-link.c +227 -0
  119. package/deps/liburing/liburing/test/poll-many.c +208 -0
  120. package/deps/liburing/liburing/test/poll-mshot-update.c +273 -0
  121. package/deps/liburing/liburing/test/poll-ring.c +48 -0
  122. package/deps/liburing/liburing/test/poll-v-poll.c +353 -0
  123. package/deps/liburing/liburing/test/poll.c +109 -0
  124. package/deps/liburing/liburing/test/probe.c +137 -0
  125. package/deps/liburing/liburing/test/read-write.c +876 -0
  126. package/deps/liburing/liburing/test/register-restrictions.c +633 -0
  127. package/deps/liburing/liburing/test/rename.c +134 -0
  128. package/deps/liburing/liburing/test/ring-leak.c +173 -0
  129. package/deps/liburing/liburing/test/ring-leak2.c +249 -0
  130. package/deps/liburing/liburing/test/rsrc_tags.c +449 -0
  131. package/deps/liburing/liburing/test/runtests-loop.sh +16 -0
  132. package/deps/liburing/liburing/test/runtests.sh +170 -0
  133. package/deps/liburing/liburing/test/rw_merge_test.c +97 -0
  134. package/deps/liburing/liburing/test/self.c +91 -0
  135. package/deps/liburing/liburing/test/send_recv.c +291 -0
  136. package/deps/liburing/liburing/test/send_recvmsg.c +345 -0
  137. package/deps/liburing/liburing/test/sendmsg_fs_cve.c +198 -0
  138. package/deps/liburing/liburing/test/shared-wq.c +84 -0
  139. package/deps/liburing/liburing/test/short-read.c +75 -0
  140. package/deps/liburing/liburing/test/shutdown.c +163 -0
  141. package/deps/liburing/liburing/test/sigfd-deadlock.c +74 -0
  142. package/deps/liburing/liburing/test/socket-rw-eagain.c +156 -0
  143. package/deps/liburing/liburing/test/socket-rw.c +147 -0
  144. package/deps/liburing/liburing/test/splice.c +511 -0
  145. package/deps/liburing/liburing/test/sq-full-cpp.cc +45 -0
  146. package/deps/liburing/liburing/test/sq-full.c +45 -0
  147. package/deps/liburing/liburing/test/sq-poll-dup.c +200 -0
  148. package/deps/liburing/liburing/test/sq-poll-kthread.c +168 -0
  149. package/deps/liburing/liburing/test/sq-poll-share.c +137 -0
  150. package/deps/liburing/liburing/test/sq-space_left.c +159 -0
  151. package/deps/liburing/liburing/test/sqpoll-cancel-hang.c +159 -0
  152. package/deps/liburing/liburing/test/sqpoll-disable-exit.c +195 -0
  153. package/deps/liburing/liburing/test/sqpoll-exit-hang.c +77 -0
  154. package/deps/liburing/liburing/test/sqpoll-sleep.c +68 -0
  155. package/deps/liburing/liburing/test/statx.c +172 -0
  156. package/deps/liburing/liburing/test/stdout.c +232 -0
  157. package/deps/liburing/liburing/test/submit-link-fail.c +154 -0
  158. package/deps/liburing/liburing/test/submit-reuse.c +239 -0
  159. package/deps/liburing/liburing/test/symlink.c +116 -0
  160. package/deps/liburing/liburing/test/teardowns.c +58 -0
  161. package/deps/liburing/liburing/test/thread-exit.c +131 -0
  162. package/deps/liburing/liburing/test/timeout-new.c +246 -0
  163. package/deps/liburing/liburing/test/timeout-overflow.c +204 -0
  164. package/deps/liburing/liburing/test/timeout.c +1354 -0
  165. package/deps/liburing/liburing/test/unlink.c +111 -0
  166. package/deps/liburing/liburing/test/wakeup-hang.c +162 -0
  167. package/deps/liburing/liburing.gyp +20 -0
  168. package/deps/rocksdb/rocksdb/db/corruption_test.cc +62 -0
  169. package/deps/rocksdb/rocksdb/db/db_impl/db_impl.h +7 -62
  170. package/deps/rocksdb/rocksdb/db/db_impl/db_impl_files.cc +25 -11
  171. package/deps/rocksdb/rocksdb/db/db_impl/db_impl_open.cc +74 -155
  172. package/deps/rocksdb/rocksdb/db/db_impl/db_impl_secondary.cc +1 -2
  173. package/deps/rocksdb/rocksdb/db/db_impl/db_impl_secondary.h +2 -2
  174. package/deps/rocksdb/rocksdb/env/fs_posix.cc +13 -0
  175. package/deps/rocksdb/rocksdb/file/file_prefetch_buffer.cc +4 -2
  176. package/deps/rocksdb/rocksdb/file/file_prefetch_buffer.h +22 -4
  177. package/deps/rocksdb/rocksdb/file/prefetch_test.cc +5 -0
  178. package/deps/rocksdb/rocksdb/include/rocksdb/file_system.h +15 -0
  179. package/deps/rocksdb/rocksdb/include/rocksdb/statistics.h +5 -0
  180. package/deps/rocksdb/rocksdb/include/rocksdb/version.h +1 -1
  181. package/deps/rocksdb/rocksdb/monitoring/statistics.cc +3 -0
  182. package/deps/rocksdb/rocksdb/monitoring/stats_history_test.cc +3 -7
  183. package/deps/rocksdb/rocksdb/table/block_based/block_based_table_reader.h +2 -1
  184. package/deps/rocksdb/rocksdb/table/block_based/block_based_table_reader_test.cc +44 -29
  185. package/deps/rocksdb/rocksdb.gyp +4 -3
  186. package/package.json +1 -1
  187. package/prebuilds/darwin-arm64/node.napi.node +0 -0
  188. package/prebuilds/darwin-x64/node.napi.node +0 -0
  189. package/prebuilds/linux-x64/node.napi.node +0 -0
  190. package/prebuilds/prebuilds/linux-x64/node.napi.node +0 -0
@@ -0,0 +1,89 @@
1
+ /* SPDX-License-Identifier: MIT */
2
+ /*
3
+ * Description: Single depth submit+wait poll hang test
4
+ *
5
+ */
6
+ #include <errno.h>
7
+ #include <stdio.h>
8
+ #include <unistd.h>
9
+ #include <stdlib.h>
10
+ #include <string.h>
11
+ #include <fcntl.h>
12
+
13
+ #include "helpers.h"
14
+ #include "liburing.h"
15
+
16
+ #define BLOCKS 4096
17
+
18
+ int main(int argc, char *argv[])
19
+ {
20
+ struct io_uring ring;
21
+ struct io_uring_sqe *sqe;
22
+ struct io_uring_cqe *cqe;
23
+ struct iovec iov;
24
+ char buf[32];
25
+ off_t offset;
26
+ unsigned blocks;
27
+ int ret, fd;
28
+
29
+ if (argc > 1)
30
+ return 0;
31
+
32
+ t_posix_memalign(&iov.iov_base, 4096, 4096);
33
+ iov.iov_len = 4096;
34
+
35
+ ret = io_uring_queue_init(1, &ring, IORING_SETUP_IOPOLL);
36
+ if (ret) {
37
+ fprintf(stderr, "ring setup failed\n");
38
+ return 1;
39
+
40
+ }
41
+
42
+ sprintf(buf, "./XXXXXX");
43
+ fd = mkostemp(buf, O_WRONLY | O_DIRECT | O_CREAT);
44
+ if (fd < 0) {
45
+ perror("mkostemp");
46
+ return 1;
47
+ }
48
+
49
+ offset = 0;
50
+ blocks = BLOCKS;
51
+ do {
52
+ sqe = io_uring_get_sqe(&ring);
53
+ if (!sqe) {
54
+ fprintf(stderr, "get sqe failed\n");
55
+ goto err;
56
+ }
57
+ io_uring_prep_writev(sqe, fd, &iov, 1, offset);
58
+ ret = io_uring_submit_and_wait(&ring, 1);
59
+ if (ret < 0) {
60
+ fprintf(stderr, "submit_and_wait: %d\n", ret);
61
+ goto err;
62
+ }
63
+ ret = io_uring_wait_cqe(&ring, &cqe);
64
+ if (ret < 0) {
65
+ fprintf(stderr, "wait completion: %d\n", ret);
66
+ goto err;
67
+ }
68
+ if (cqe->res != 4096) {
69
+ if (cqe->res == -EOPNOTSUPP)
70
+ goto skipped;
71
+ goto err;
72
+ }
73
+ io_uring_cqe_seen(&ring, cqe);
74
+ offset += 4096;
75
+ } while (--blocks);
76
+
77
+ close(fd);
78
+ unlink(buf);
79
+ return 0;
80
+ err:
81
+ close(fd);
82
+ unlink(buf);
83
+ return 1;
84
+ skipped:
85
+ fprintf(stderr, "Polling not supported in current dir, test skipped\n");
86
+ close(fd);
87
+ unlink(buf);
88
+ return 0;
89
+ }
@@ -0,0 +1,93 @@
1
+ /* SPDX-License-Identifier: MIT */
2
+ #include <stdio.h>
3
+ #include <time.h>
4
+ #include <sys/time.h>
5
+ #include "liburing.h"
6
+
7
+ static unsigned long long mtime_since(const struct timeval *s,
8
+ const struct timeval *e)
9
+ {
10
+ long long sec, usec;
11
+
12
+ sec = e->tv_sec - s->tv_sec;
13
+ usec = (e->tv_usec - s->tv_usec);
14
+ if (sec > 0 && usec < 0) {
15
+ sec--;
16
+ usec += 1000000;
17
+ }
18
+
19
+ sec *= 1000;
20
+ usec /= 1000;
21
+ return sec + usec;
22
+ }
23
+
24
+ static unsigned long long mtime_since_now(struct timeval *tv)
25
+ {
26
+ struct timeval end;
27
+
28
+ gettimeofday(&end, NULL);
29
+ return mtime_since(tv, &end);
30
+ }
31
+
32
+ int main(int argc, char *argv[])
33
+ {
34
+ struct __kernel_timespec ts1, ts2;
35
+ struct io_uring_cqe *cqe;
36
+ struct io_uring_sqe *sqe;
37
+ struct io_uring ring;
38
+ unsigned long msec;
39
+ struct timeval tv;
40
+ int ret;
41
+
42
+ if (argc > 1)
43
+ return 0;
44
+
45
+ ret = io_uring_queue_init(32, &ring, 0);
46
+ if (ret) {
47
+ fprintf(stderr, "io_uring_queue_init=%d\n", ret);
48
+ return 1;
49
+ }
50
+
51
+ sqe = io_uring_get_sqe(&ring);
52
+ io_uring_prep_nop(sqe);
53
+ ret = io_uring_submit(&ring);
54
+ if (ret != 1) {
55
+ fprintf(stderr, "io_uring_submit1=%d\n", ret);
56
+ return 1;
57
+ }
58
+
59
+
60
+ ts1.tv_sec = 5,
61
+ ts1.tv_nsec = 0;
62
+ ret = io_uring_wait_cqe_timeout(&ring, &cqe, &ts1);
63
+ if (ret) {
64
+ fprintf(stderr, "io_uring_wait_cqe_timeout=%d\n", ret);
65
+ return 1;
66
+ }
67
+ io_uring_cqe_seen(&ring, cqe);
68
+ gettimeofday(&tv, NULL);
69
+
70
+ ts2.tv_sec = 1;
71
+ ts2.tv_nsec = 0;
72
+ sqe = io_uring_get_sqe(&ring);
73
+ io_uring_prep_timeout(sqe, &ts2, 0, 0);
74
+ sqe->user_data = 89;
75
+ ret = io_uring_submit(&ring);
76
+ if (ret != 1) {
77
+ fprintf(stderr, "io_uring_submit2=%d\n", ret);
78
+ return 1;
79
+ }
80
+
81
+ io_uring_wait_cqe(&ring, &cqe);
82
+ io_uring_cqe_seen(&ring, cqe);
83
+ msec = mtime_since_now(&tv);
84
+ if (msec >= 900 && msec <= 1100) {
85
+ io_uring_queue_exit(&ring);
86
+ return 0;
87
+ }
88
+
89
+ fprintf(stderr, "%s: Timeout seems wonky (got %lu)\n", __FUNCTION__,
90
+ msec);
91
+ io_uring_queue_exit(&ring);
92
+ return 1;
93
+ }
@@ -0,0 +1,106 @@
1
+ /* SPDX-License-Identifier: MIT */
2
+ #include <errno.h>
3
+ #include <stdio.h>
4
+ #include <unistd.h>
5
+ #include <stdlib.h>
6
+ #include <string.h>
7
+ #include <fcntl.h>
8
+
9
+ #include "liburing.h"
10
+
11
+ static int register_file(struct io_uring *ring)
12
+ {
13
+ char buf[32];
14
+ int ret, fd;
15
+
16
+ sprintf(buf, "./XXXXXX");
17
+ fd = mkstemp(buf);
18
+ if (fd < 0) {
19
+ perror("open");
20
+ return 1;
21
+ }
22
+
23
+ ret = io_uring_register_files(ring, &fd, 1);
24
+ if (ret) {
25
+ fprintf(stderr, "file register %d\n", ret);
26
+ return 1;
27
+ }
28
+
29
+ ret = io_uring_unregister_files(ring);
30
+ if (ret) {
31
+ fprintf(stderr, "file register %d\n", ret);
32
+ return 1;
33
+ }
34
+
35
+ unlink(buf);
36
+ close(fd);
37
+ return 0;
38
+ }
39
+
40
+ static int test_single_fsync(struct io_uring *ring)
41
+ {
42
+ struct io_uring_cqe *cqe;
43
+ struct io_uring_sqe *sqe;
44
+ char buf[32];
45
+ int fd, ret;
46
+
47
+ sprintf(buf, "./XXXXXX");
48
+ fd = mkstemp(buf);
49
+ if (fd < 0) {
50
+ perror("open");
51
+ return 1;
52
+ }
53
+
54
+ sqe = io_uring_get_sqe(ring);
55
+ if (!sqe) {
56
+ printf("get sqe failed\n");
57
+ goto err;
58
+ }
59
+
60
+ io_uring_prep_fsync(sqe, fd, 0);
61
+
62
+ ret = io_uring_submit(ring);
63
+ if (ret <= 0) {
64
+ printf("sqe submit failed: %d\n", ret);
65
+ goto err;
66
+ }
67
+
68
+ ret = io_uring_wait_cqe(ring, &cqe);
69
+ if (ret < 0) {
70
+ printf("wait completion %d\n", ret);
71
+ goto err;
72
+ }
73
+
74
+ io_uring_cqe_seen(ring, cqe);
75
+ unlink(buf);
76
+ return 0;
77
+ err:
78
+ unlink(buf);
79
+ return 1;
80
+ }
81
+
82
+ int main(int argc, char *argv[])
83
+ {
84
+ struct io_uring ring;
85
+ int ret;
86
+
87
+ if (argc > 1)
88
+ return 0;
89
+
90
+ ret = io_uring_queue_init(8, &ring, 0);
91
+ if (ret) {
92
+ printf("ring setup failed\n");
93
+ return 1;
94
+ }
95
+
96
+ ret = register_file(&ring);
97
+ if (ret)
98
+ return ret;
99
+ ret = test_single_fsync(&ring);
100
+ if (ret) {
101
+ printf("test_single_fsync failed\n");
102
+ return ret;
103
+ }
104
+
105
+ return 0;
106
+ }
@@ -0,0 +1,53 @@
1
+ /* SPDX-License-Identifier: MIT */
2
+ // autogenerated by syzkaller (https://github.com/google/syzkaller)
3
+
4
+ #include <endian.h>
5
+ #include <stdint.h>
6
+ #include <stdio.h>
7
+ #include <stdlib.h>
8
+ #include <string.h>
9
+ #include <sys/types.h>
10
+ #include <sys/mman.h>
11
+ #include <unistd.h>
12
+
13
+ #include "liburing.h"
14
+ #include "../src/syscall.h"
15
+
16
+ int main(int argc, char *argv[])
17
+ {
18
+ if (argc > 1)
19
+ return 0;
20
+
21
+ mmap((void *) 0x20000000, 0x1000000, 3, 0x32, -1, 0);
22
+
23
+ *(uint32_t*)0x20000000 = 0;
24
+ *(uint32_t*)0x20000004 = 0;
25
+ *(uint32_t*)0x20000008 = 6;
26
+ *(uint32_t*)0x2000000c = 0;
27
+ *(uint32_t*)0x20000010 = 0x3af;
28
+ *(uint32_t*)0x20000014 = 0;
29
+ *(uint32_t*)0x20000018 = 0;
30
+ *(uint32_t*)0x2000001c = 0;
31
+ *(uint32_t*)0x20000020 = 0;
32
+ *(uint32_t*)0x20000024 = 0;
33
+ *(uint32_t*)0x20000028 = 0;
34
+ *(uint32_t*)0x2000002c = 0;
35
+ *(uint32_t*)0x20000030 = 0;
36
+ *(uint32_t*)0x20000034 = 0;
37
+ *(uint32_t*)0x20000038 = 0;
38
+ *(uint32_t*)0x2000003c = 0;
39
+ *(uint32_t*)0x20000040 = 0;
40
+ *(uint32_t*)0x20000044 = 0;
41
+ *(uint64_t*)0x20000048 = 0;
42
+ *(uint32_t*)0x20000050 = 0;
43
+ *(uint32_t*)0x20000054 = 0;
44
+ *(uint32_t*)0x20000058 = 0;
45
+ *(uint32_t*)0x2000005c = 0;
46
+ *(uint32_t*)0x20000060 = 0;
47
+ *(uint32_t*)0x20000064 = 0;
48
+ *(uint32_t*)0x20000068 = 0;
49
+ *(uint32_t*)0x2000006c = 0;
50
+ *(uint64_t*)0x20000070 = 0;
51
+ __sys_io_uring_setup(0x7a6, (struct io_uring_params *) 0x20000000UL);
52
+ return 0;
53
+ }
@@ -0,0 +1,312 @@
1
+ prefix ?= /usr
2
+ datadir ?= $(prefix)/share
3
+
4
+ INSTALL=install
5
+
6
+ ifneq ($(MAKECMDGOALS),clean)
7
+ include ../config-host.mak
8
+ endif
9
+
10
+ CPPFLAGS ?=
11
+ override CPPFLAGS += -D_GNU_SOURCE -D__SANE_USERSPACE_TYPES__ \
12
+ -I../src/include/ -include ../config-host.h
13
+ CFLAGS ?= -g -O2
14
+ XCFLAGS =
15
+ override CFLAGS += -D_GNU_SOURCE \
16
+ -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare \
17
+ -L../src/
18
+
19
+ ifdef CONFIG_HAVE_STRINGOP_OVERFLOW
20
+ XCFLAGS += -Wstringop-overflow=0
21
+ endif
22
+ ifdef CONFIG_HAVE_ARRAY_BOUNDS
23
+ XCFLAGS += -Warray-bounds=0
24
+ endif
25
+
26
+ CXXFLAGS ?=
27
+ override CXXFLAGS += $(CFLAGS) -std=c++11
28
+
29
+ test_targets += \
30
+ 232c93d07b74-test \
31
+ 35fa71a030ca-test \
32
+ 500f9fbadef8-test \
33
+ 7ad0e4b2f83c-test \
34
+ 8a9973408177-test \
35
+ 917257daa0fe-test \
36
+ a0908ae19763-test \
37
+ a4c0b3decb33-test \
38
+ accept \
39
+ accept-link \
40
+ accept-reuse \
41
+ accept-test \
42
+ across-fork splice \
43
+ b19062a56726-test \
44
+ b5837bd5311d-test \
45
+ ce593a6c480a-test \
46
+ close-opath \
47
+ connect \
48
+ cq-full \
49
+ cq-overflow \
50
+ cq-peek-batch \
51
+ cq-ready \
52
+ cq-size \
53
+ d4ae271dfaae-test \
54
+ d77a67ed5f27-test \
55
+ defer \
56
+ double-poll-crash \
57
+ eeed8b54e0df-test \
58
+ empty-eownerdead \
59
+ eventfd \
60
+ eventfd-disable \
61
+ eventfd-ring \
62
+ fadvise \
63
+ fallocate \
64
+ fc2a85cb02ef-test \
65
+ file-register \
66
+ file-update \
67
+ files-exit-hang-poll \
68
+ files-exit-hang-timeout \
69
+ fixed-link \
70
+ fsync \
71
+ hardlink \
72
+ io-cancel \
73
+ io_uring_enter \
74
+ io_uring_register \
75
+ io_uring_setup \
76
+ iopoll \
77
+ lfs-openat \
78
+ lfs-openat-write \
79
+ link \
80
+ link-timeout \
81
+ link_drain \
82
+ madvise \
83
+ mkdir \
84
+ multicqes_drain \
85
+ nop \
86
+ nop-all-sizes \
87
+ open-close \
88
+ openat2 \
89
+ personality \
90
+ pipe-eof \
91
+ pipe-reuse \
92
+ poll \
93
+ poll-cancel \
94
+ poll-cancel-ton \
95
+ poll-link \
96
+ poll-many \
97
+ poll-mshot-update \
98
+ poll-ring \
99
+ poll-v-poll \
100
+ probe \
101
+ read-write \
102
+ register-restrictions \
103
+ rename \
104
+ ring-leak \
105
+ ring-leak2 \
106
+ rw_merge_test \
107
+ self \
108
+ send_recv \
109
+ send_recvmsg \
110
+ shared-wq \
111
+ short-read \
112
+ shutdown \
113
+ sigfd-deadlock \
114
+ socket-rw \
115
+ socket-rw-eagain \
116
+ sq-full \
117
+ sq-poll-dup \
118
+ sq-poll-kthread \
119
+ sq-poll-share \
120
+ sqpoll-disable-exit \
121
+ sqpoll-exit-hang \
122
+ sqpoll-cancel-hang \
123
+ sqpoll-sleep \
124
+ sq-space_left \
125
+ stdout \
126
+ submit-reuse \
127
+ submit-link-fail \
128
+ symlink \
129
+ teardowns \
130
+ thread-exit \
131
+ timeout \
132
+ timeout-new \
133
+ timeout-overflow \
134
+ unlink \
135
+ wakeup-hang \
136
+ sendmsg_fs_cve \
137
+ rsrc_tags \
138
+ # EOL
139
+
140
+ all_targets += $(test_targets)
141
+
142
+ include ../Makefile.quiet
143
+
144
+ ifdef CONFIG_HAVE_STATX
145
+ test_targets += statx
146
+ endif
147
+ all_targets += statx
148
+
149
+ ifdef CONFIG_HAVE_CXX
150
+ test_targets += sq-full-cpp
151
+ endif
152
+ all_targets += sq-full-cpp
153
+
154
+ helpers = helpers.o
155
+
156
+ all: ${helpers} $(test_targets)
157
+
158
+ helpers.o: helpers.c helpers.c
159
+ $(QUIET_CC)$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $< -luring
160
+
161
+ %: %.c ${helpers} helpers.h
162
+ $(QUIET_CC)$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $< ${helpers} -luring $(XCFLAGS)
163
+
164
+ %: %.cc ${helpers} helpers.h
165
+ $(QUIET_CXX)$(CXX) $(CPPFLAGS) $(CXXFLAGS) -o $@ $< ${helpers} -luring $(XCFLAGS)
166
+
167
+ test_srcs := \
168
+ helpers.c \
169
+ 232c93d07b74-test.c \
170
+ 35fa71a030ca-test.c \
171
+ 500f9fbadef8-test.c \
172
+ 7ad0e4b2f83c-test.c \
173
+ 8a9973408177-test.c \
174
+ 917257daa0fe-test.c \
175
+ a0908ae19763-test.c \
176
+ a4c0b3decb33-test.c \
177
+ accept-link.c \
178
+ accept-reuse.c \
179
+ accept-test.c \
180
+ accept.c \
181
+ across-fork.c \
182
+ b19062a56726-test.c \
183
+ b5837bd5311d-test.c \
184
+ ce593a6c480a-test.c \
185
+ close-opath.c \
186
+ connect.c \
187
+ cq-full.c \
188
+ cq-overflow.c \
189
+ cq-peek-batch.c \
190
+ cq-ready.c\
191
+ cq-size.c \
192
+ d4ae271dfaae-test.c \
193
+ d77a67ed5f27-test.c \
194
+ defer.c \
195
+ double-poll-crash.c \
196
+ eeed8b54e0df-test.c \
197
+ empty-eownerdead.c \
198
+ eventfd-disable.c \
199
+ eventfd-ring.c \
200
+ eventfd.c \
201
+ fadvise.c \
202
+ fallocate.c \
203
+ fc2a85cb02ef-test.c \
204
+ file-register.c \
205
+ file-update.c \
206
+ files-exit-hang-poll.c \
207
+ files-exit-hang-timeout.c \
208
+ fixed-link.c \
209
+ fsync.c \
210
+ hardlink.c \
211
+ io-cancel.c \
212
+ io_uring_enter.c \
213
+ io_uring_register.c \
214
+ io_uring_setup.c \
215
+ iopoll.c \
216
+ lfs-openat-write.c \
217
+ lfs-openat.c \
218
+ link-timeout.c \
219
+ link.c \
220
+ link_drain.c \
221
+ madvise.c \
222
+ mkdir.c \
223
+ multicqes_drain.c \
224
+ nop-all-sizes.c \
225
+ nop.c \
226
+ open-close.c \
227
+ openat2.c \
228
+ personality.c \
229
+ pipe-eof.c \
230
+ pipe-reuse.c \
231
+ poll-cancel-ton.c \
232
+ poll-cancel.c \
233
+ poll-link.c \
234
+ poll-many.c \
235
+ poll-mshot-update.c \
236
+ poll-ring.c \
237
+ poll-v-poll.c \
238
+ poll.c \
239
+ probe.c \
240
+ read-write.c \
241
+ register-restrictions.c \
242
+ rename.c \
243
+ ring-leak.c \
244
+ ring-leak2.c \
245
+ rw_merge_test.c \
246
+ self.c \
247
+ send_recvmsg.c \
248
+ shared-wq.c \
249
+ short-read.c \
250
+ shutdown.c \
251
+ sigfd-deadlock.c \
252
+ socket-rw.c \
253
+ socket-rw-eagain.c \
254
+ splice.c \
255
+ sq-full-cpp.cc \
256
+ sq-full.c \
257
+ sq-poll-dup.c \
258
+ sq-poll-kthread.c \
259
+ sq-poll-share.c \
260
+ sqpoll-disable-exit.c \
261
+ sqpoll-exit-hang.c \
262
+ sqpoll-cancel-hang.c \
263
+ sqpoll-sleep.c \
264
+ sq-space_left.c \
265
+ statx.c \
266
+ stdout.c \
267
+ submit-reuse.c \
268
+ submit-link-fail.c \
269
+ symlink.c \
270
+ teardowns.c \
271
+ thread-exit.c \
272
+ timeout-new.c \
273
+ timeout-overflow.c \
274
+ timeout.c \
275
+ unlink.c \
276
+ wakeup-hang.c \
277
+ sendmsg_fs_cve.c \
278
+ rsrc_tags.c \
279
+ # EOL
280
+
281
+ test_objs := $(patsubst %.c,%.ol,$(patsubst %.cc,%.ol,$(test_srcs)))
282
+
283
+ 35fa71a030ca-test: XCFLAGS = -lpthread
284
+ 232c93d07b74-test: XCFLAGS = -lpthread
285
+ send_recv: XCFLAGS = -lpthread
286
+ send_recvmsg: XCFLAGS = -lpthread
287
+ poll-link: XCFLAGS = -lpthread
288
+ accept-link: XCFLAGS = -lpthread
289
+ submit-reuse: XCFLAGS = -lpthread
290
+ poll-v-poll: XCFLAGS = -lpthread
291
+ across-fork: XCFLAGS = -lpthread
292
+ ce593a6c480a-test: XCFLAGS = -lpthread
293
+ wakeup-hang: XCFLAGS = -lpthread
294
+ pipe-eof: XCFLAGS = -lpthread
295
+ timeout-new: XCFLAGS = -lpthread
296
+ thread-exit: XCFLAGS = -lpthread
297
+ ring-leak2: XCFLAGS = -lpthread
298
+ poll-mshot-update: XCFLAGS = -lpthread
299
+
300
+ install: $(test_targets) runtests.sh runtests-loop.sh
301
+ $(INSTALL) -D -d -m 755 $(datadir)/liburing-test/
302
+ $(INSTALL) -D -m 755 $(test_targets) $(datadir)/liburing-test/
303
+ $(INSTALL) -D -m 755 runtests.sh $(datadir)/liburing-test/
304
+ $(INSTALL) -D -m 755 runtests-loop.sh $(datadir)/liburing-test/
305
+ clean:
306
+ @rm -f $(all_targets) $(test_objs) helpers.o output/*
307
+ @rm -rf output/
308
+
309
+ runtests: all
310
+ @./runtests.sh $(test_targets)
311
+ runtests-loop: all
312
+ @./runtests-loop.sh $(test_targets)
@@ -0,0 +1,58 @@
1
+ /* SPDX-License-Identifier: MIT */
2
+ // autogenerated by syzkaller (https://github.com/google/syzkaller)
3
+
4
+ #include <endian.h>
5
+ #include <stdint.h>
6
+ #include <stdio.h>
7
+ #include <stdlib.h>
8
+ #include <string.h>
9
+ #include <sys/types.h>
10
+ #include <sys/mman.h>
11
+ #include <unistd.h>
12
+
13
+ #include "liburing.h"
14
+ #include "../src/syscall.h"
15
+
16
+ uint64_t r[1] = {0xffffffffffffffff};
17
+
18
+ int main(int argc, char *argv[])
19
+ {
20
+ if (argc > 1)
21
+ return 0;
22
+ mmap((void *) 0x20000000, 0x1000000, 3, 0x32, -1, 0);
23
+ intptr_t res = 0;
24
+ *(uint32_t*)0x20000080 = 0;
25
+ *(uint32_t*)0x20000084 = 0;
26
+ *(uint32_t*)0x20000088 = 0;
27
+ *(uint32_t*)0x2000008c = 0;
28
+ *(uint32_t*)0x20000090 = 0;
29
+ *(uint32_t*)0x20000094 = 0;
30
+ *(uint32_t*)0x20000098 = 0;
31
+ *(uint32_t*)0x2000009c = 0;
32
+ *(uint32_t*)0x200000a0 = 0;
33
+ *(uint32_t*)0x200000a4 = 0;
34
+ *(uint32_t*)0x200000a8 = 0;
35
+ *(uint32_t*)0x200000ac = 0;
36
+ *(uint32_t*)0x200000b0 = 0;
37
+ *(uint32_t*)0x200000b4 = 0;
38
+ *(uint32_t*)0x200000b8 = 0;
39
+ *(uint32_t*)0x200000bc = 0;
40
+ *(uint32_t*)0x200000c0 = 0;
41
+ *(uint32_t*)0x200000c4 = 0;
42
+ *(uint64_t*)0x200000c8 = 0;
43
+ *(uint32_t*)0x200000d0 = 0;
44
+ *(uint32_t*)0x200000d4 = 0;
45
+ *(uint32_t*)0x200000d8 = 0;
46
+ *(uint32_t*)0x200000dc = 0;
47
+ *(uint32_t*)0x200000e0 = 0;
48
+ *(uint32_t*)0x200000e4 = 0;
49
+ *(uint32_t*)0x200000e8 = 0;
50
+ *(uint32_t*)0x200000ec = 0;
51
+ *(uint64_t*)0x200000f0 = 0;
52
+ res = __sys_io_uring_setup(0xa4, (struct io_uring_params *) 0x20000080);
53
+ if (res != -1)
54
+ r[0] = res;
55
+ *(uint32_t*)0x20000280 = -1;
56
+ __sys_io_uring_register(r[0], 2, (const void *) 0x20000280, 1);
57
+ return 0;
58
+ }