Skip to content

Commit 13c2239

Browse files
isilenceaxboe
authored andcommitted
io_uring/rsrc: zero node's rsrc data on alloc
struct io_rsrc_node::rsrc_data field is initialised on rsrc removal and shouldn't be used before that, still let's play safe and zero the field on alloc. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/09bd03cedc8da8a7974c5e6e4bf0489fd16593ab.1681210788.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 528407b commit 13c2239

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

io_uring/rsrc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ static struct io_rsrc_node *io_rsrc_node_alloc(struct io_ring_ctx *ctx)
218218
return NULL;
219219
}
220220

221+
ref_node->rsrc_data = NULL;
221222
ref_node->refs = 1;
222223
INIT_LIST_HEAD(&ref_node->node);
223224
INIT_LIST_HEAD(&ref_node->item_list);

0 commit comments

Comments
 (0)