Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

io_uring: fix incorrect io_kiocb reference in io_link_skb

In io_link_skb function, there is a bug where prev_notif is incorrectly
assigned using 'nd' instead of 'prev_nd'. This causes the context
validation check to compare the current notification with itself instead
of comparing it with the previous notification.

Fix by using the correct prev_nd parameter when obtaining prev_notif.

Signed-off-by: Yang Xiuwei <yangxiuwei@kylinos.cn>
Reviewed-by: Pavel Begunkov <asml.silence@gmail.com>
Fixes: 6fe4220912d19 ("io_uring/notif: implement notification stacking")
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Yang Xiuwei and committed by
Jens Axboe
2c139a47 df8922af

+1 -1
+1 -1
io_uring/notif.c
··· 85 85 return -EEXIST; 86 86 87 87 prev_nd = container_of(prev_uarg, struct io_notif_data, uarg); 88 - prev_notif = cmd_to_io_kiocb(nd); 88 + prev_notif = cmd_to_io_kiocb(prev_nd); 89 89 90 90 /* make sure all noifications can be finished in the same task_work */ 91 91 if (unlikely(notif->ctx != prev_notif->ctx ||