Skip to content

Commit de6ed1b

Browse files
isilenceaxboe
authored andcommitted
io_uring/zcrx: check ctrl op payload struct sizes
Add a build check that ctrl payloads are of the same size and don't grow struct zcrx_ctrl. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://patch.msgid.link/af66caf9776d18e9ff880ab828eb159a6a03caf5.1774261953.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 5c727ce commit de6ed1b

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

io_uring/zcrx.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,6 +1253,8 @@ int io_zcrx_ctrl(struct io_ring_ctx *ctx, void __user *arg, unsigned nr_args)
12531253
struct zcrx_ctrl ctrl;
12541254
struct io_zcrx_ifq *zcrx;
12551255

1256+
BUILD_BUG_ON(sizeof(ctrl.zc_export) != sizeof(ctrl.zc_flush));
1257+
12561258
if (nr_args)
12571259
return -EINVAL;
12581260
if (copy_from_user(&ctrl, arg, sizeof(ctrl)))

0 commit comments

Comments
 (0)