summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2022-05-17 12:56:12 -0600
committerJens Axboe <axboe@kernel.dk>2022-05-17 12:56:12 -0600
commitbb756586aa03e88a9b0b4beb09d9880fffa8cfc7 (patch)
tree5e161e67bd1d47ab937d178440ccc144046d42e3
parent03e142c9cc9d6ab822a93e8e730afd45fa544fa6 (diff)
downloadliburing-bb756586aa03e88a9b0b4beb09d9880fffa8cfc7.tar.gz
liburing-bb756586aa03e88a9b0b4beb09d9880fffa8cfc7.tar.bz2
test/msg-ring.c: add IOPOLL test
We do allow MSG_RING on an IOPOLL ring, add a test case for it. syzbot found an issue with attempting to poll the MSG_RING request, which would crash. This would trigger it too. Link: https://git.kernel.dk/cgit/linux-block/commit/?h=io_uring-5.18&id=aa184e8671f0f911fc2fb3f68cd506e4d7838faa Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--test/msg-ring.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/test/msg-ring.c b/test/msg-ring.c
index 209d61c..48c4a64 100644
--- a/test/msg-ring.c
+++ b/test/msg-ring.c
@@ -177,7 +177,7 @@ err:
int main(int argc, char *argv[])
{
- struct io_uring ring, ring2;
+ struct io_uring ring, ring2, pring;
pthread_t thread;
void *tret;
int ret;
@@ -195,6 +195,11 @@ int main(int argc, char *argv[])
fprintf(stderr, "ring setup failed: %d\n", ret);
return 1;
}
+ ret = io_uring_queue_init(8, &pring, IORING_SETUP_IOPOLL);
+ if (ret) {
+ fprintf(stderr, "ring setup failed: %d\n", ret);
+ return 1;
+ }
ret = test_own(&ring);
if (ret) {
@@ -205,6 +210,11 @@ int main(int argc, char *argv[])
fprintf(stdout, "Skipped\n");
return 0;
}
+ ret = test_own(&pring);
+ if (ret) {
+ fprintf(stderr, "test_own iopoll failed\n");
+ return ret;
+ }
ret = test_invalid(&ring);
if (ret) {