From: Pavel Begunkov Date: Mon, 23 Mar 2026 12:44:04 +0000 (+0000) Subject: io_uring/zcrx: check ctrl op payload struct sizes X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=de6ed1b323fc50eaa3d7847274cff51055b5c498;p=thirdparty%2Fkernel%2Flinux.git 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 Link: https://patch.msgid.link/af66caf9776d18e9ff880ab828eb159a6a03caf5.1774261953.git.asml.silence@gmail.com Signed-off-by: Jens Axboe --- diff --git a/io_uring/zcrx.c b/io_uring/zcrx.c index 32829775fb6be..e2e0df78dae19 100644 --- a/io_uring/zcrx.c +++ b/io_uring/zcrx.c @@ -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)))