Re: [PATCH V3 1/2] io_uring: retain top 8bits of uring_cmd flags for kernel internal use

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


On 9/22/23 10:09 AM, Ming Lei wrote:
> diff --git a/io_uring/uring_cmd.c b/io_uring/uring_cmd.c
> index 537795fddc87..52a455b67163 100644
> --- a/io_uring/uring_cmd.c
> +++ b/io_uring/uring_cmd.c
> @@ -90,7 +90,7 @@ int io_uring_cmd_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
>  	if (sqe->__pad1)
>  		return -EINVAL;
> -	ioucmd->flags = READ_ONCE(sqe->uring_cmd_flags);
> +	ioucmd->flags = READ_ONCE(sqe->uring_cmd_flags) & IORING_URING_CMD_MASK;
>  	if (ioucmd->flags & ~IORING_URING_CMD_FIXED)
>  		return -EINVAL;

Do we want to mask it here? If any of the upper bits are set at prep
time, that should be an EINVAL condition.

Jens Axboe

[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux