Skip to content

Commit 0fcccfd

Browse files
isilenceaxboe
authored andcommitted
io_uring/zcrx: fix user_struct uaf
io_free_rbuf_ring() usees a struct user_struct, which io_zcrx_ifq_free() puts it down before destroying the ring. Cc: [email protected] Fixes: 5c68645 ("io_uring/zcrx: add user_struct and mm_struct to io_zcrx_ifq") Signed-off-by: Pavel Begunkov <[email protected]> Link: https://patch.msgid.link/e560ae00960d27a810522a7efc0e201c82dff351.1776760917.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <[email protected]>
1 parent 45cd957 commit 0fcccfd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

io_uring/zcrx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,13 +579,13 @@ static void io_zcrx_ifq_free(struct io_zcrx_ifq *ifq)
579579

580580
if (ifq->area)
581581
io_zcrx_free_area(ifq, ifq->area);
582-
free_uid(ifq->user);
583582
if (ifq->mm_account)
584583
mmdrop(ifq->mm_account);
585584
if (ifq->dev)
586585
put_device(ifq->dev);
587586

588587
io_free_rbuf_ring(ifq);
588+
free_uid(ifq->user);
589589
mutex_destroy(&ifq->pp_lock);
590590
kfree(ifq);
591591
}

0 commit comments

Comments
 (0)