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>
This commit is contained in:
parent
5c727ce042
commit
de6ed1b323
1 changed files with 2 additions and 0 deletions
|
|
@ -1253,6 +1253,8 @@ int io_zcrx_ctrl(struct io_ring_ctx *ctx, void __user *arg, unsigned nr_args)
|
|||
struct zcrx_ctrl ctrl;
|
||||
struct io_zcrx_ifq *zcrx;
|
||||
|
||||
BUILD_BUG_ON(sizeof(ctrl.zc_export) != sizeof(ctrl.zc_flush));
|
||||
|
||||
if (nr_args)
|
||||
return -EINVAL;
|
||||
if (copy_from_user(&ctrl, arg, sizeof(ctrl)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue