projects
/
fio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8b60e32
)
t/io_uring: avoid null-ptr dereference in case setup_ring fails
author
Anuj Gupta
<anuj20.g@samsung.com>
Thu, 27 Apr 2023 19:44:15 +0000
(
01:14
+0530)
committer
Jens Axboe
<axboe@kernel.dk>
Thu, 27 Apr 2023 18:38:30 +0000
(12:38 -0600)
s->sq_ring.ring_entries and s->cq_ring.ring_entries will be NULL,
incase setup_ring fails. This will cause a segmentation fault. Avoid
dereferencing them in such a scenario.
Signed-off-by: Anuj Gupta <anuj20.g@samsung.com>
Link:
https://lore.kernel.org/r/20230427194415.1160701-1-anuj20.g@samsung.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
t/io_uring.c
patch
|
blob
|
blame
|
history
diff --git
a/t/io_uring.c
b/t/io_uring.c
index 2f8d63fbe67e96dbb3b95fbf93f62317f122afe5..bf0aa26ece569983dbad73567c6221b482be1db0 100644
(file)
--- a/
t/io_uring.c
+++ b/
t/io_uring.c
@@
-1059,7
+1059,8
@@
static int submitter_init(struct submitter *s)
err = 0;
} else if (!aio) {
err = setup_ring(s);
- sprintf(buf, "Engine=io_uring, sq_ring=%d, cq_ring=%d\n", *s->sq_ring.ring_entries, *s->cq_ring.ring_entries);
+ if (!err)
+ sprintf(buf, "Engine=io_uring, sq_ring=%d, cq_ring=%d\n", *s->sq_ring.ring_entries, *s->cq_ring.ring_entries);
} else {
sprintf(buf, "Engine=aio\n");
err = setup_aio(s);