]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
io_uring: Add size check for sqe->cmd
authorGovindarajulu Varadarajan <govind.varadar@gmail.com>
Thu, 19 Feb 2026 04:59:30 +0000 (20:59 -0800)
committerJens Axboe <axboe@kernel.dk>
Thu, 19 Feb 2026 14:26:26 +0000 (07:26 -0700)
commitea129e55c9e06a51a93c3f5ef3e32a6cfa3f8ec7
tree0fc192097104be2b8c63efaf57f041fc11c47f5d
parent42a6bd57ee9f930a72c26f863c72f666d6ed9ea5
io_uring: Add size check for sqe->cmd

For SQE128, sqe->cmd provides 80 bytes for uring_cmd. Add macro to
check if size of user struct does not exceed 80 bytes at compile time.
User doesn't have to track this manually during development.

Replace io_uring_sqe_cmd() inline func with macro and add
io_uring_sqe128_cmd() which checks struct
size for 16 bytes cmd and 80 bytes cmd respectively.

Signed-off-by: Govindarajulu Varadarajan <govind.varadar@gmail.com>
Reviewed-by: Caleb Sander Mateos <csander@purestorage.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/ublk_drv.c
drivers/nvme/host/ioctl.c
fs/fuse/dev_uring.c
include/linux/io_uring/cmd.h