Re: [PATCH 2/2] ksmbd: add low bound validation to FSCTL_QUERY_ALLOCATED_RANGES

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

 



On (23/03/05 21:34), Namjae Jeon wrote:
> +++ b/fs/ksmbd/smb2pdu.c
> @@ -7457,6 +7457,11 @@ static int fsctl_query_allocated_ranges(struct ksmbd_work *work, u64 id,
>  	start = le64_to_cpu(qar_req->file_offset);
>  	length = le64_to_cpu(qar_req->length);
>  
> +	if (start < 0 || length < 0) {
> +		ksmbd_fd_put(work, fp);
> +		return -EINVAL;
> +	}

Can we do sanity checking before we ksmbd_lookup_fd_fast()?



[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux