]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
io_uring/zcrx: check ctrl op payload struct sizes
authorPavel Begunkov <asml.silence@gmail.com>
Mon, 23 Mar 2026 12:44:04 +0000 (12:44 +0000)
committerJens Axboe <axboe@kernel.dk>
Wed, 1 Apr 2026 16:21:13 +0000 (10:21 -0600)
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>
io_uring/zcrx.c

index 32829775fb6be9927d999a6b704e3627519ff854..e2e0df78dae19ef6d181e36508086dafa413a72e 100644 (file)
@@ -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)))