Skip to contentSkip to conversation

io_uring/zcrx: fix user_struct uaf

PATCH Applied Pavel Begunkov 2 participants 2 messages Apr 21

Subsystems (4)
lore
Share & tools
lore

Pavel Begunkov

author maintainer
#0 lore raw

PATCH 1/1 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.

Fixes 5c686456a4e83 ("io_uring/zcrx: add user_struct and mm_struct to io_zcrx_ifq")
---
 io_uring/zcrx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
io_uring/zcrx.c +1 -1
index 9a83d7eb4210..fab3693ecb0d 100644
@@ -579,13 +579,13 @@ static void io_zcrx_ifq_free(struct io_zcrx_ifq *ifq)
 
 	if (ifq->area)
 		io_zcrx_free_area(ifq, ifq->area);
-	free_uid(ifq->user);
 	if (ifq->mm_account)
 		mmdrop(ifq->mm_account);
 	if (ifq->dev)
 		put_device(ifq->dev);
 
 	io_free_rbuf_ring(ifq);
+	free_uid(ifq->user);
 	mutex_destroy(&ifq->pp_lock);
 	kfree(ifq);
 }
Signature · 1 line
2.53.0
maintainer Applied
#1 lore raw
Quoted 2 lines · Pavel Begunkov

io_free_rbuf_ring() usees a struct user_struct, which io_zcrx_ifq_free() puts it down before destroying the ring.

Applied, thanks!

[1/1] io_uring/zcrx: fix user_struct uaf

      commit: 17a2407de81bf3ef450fddb89230ac10141be110

Best regards,

Signature · 1 line
Jens Axboe