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 RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux