2024-01-09 13:09:25

by Gao Xiang

[permalink] [raw]
Subject: Re: [PATCH 5/6] cachefiles: Fix signed/unsigned mixup



On 2024/1/9 19:20, David Howells wrote:
> In __cachefiles_prepare_write(), the start and pos variables were made
> unsigned 64-bit so that the casts in the checking could be got rid of -
> which should be fine since absolute file offsets can't be negative, except
> that an error code may be obtained from vfs_llseek(), which *would* be
> negative. This breaks the error check.
>
> Fix this for now by reverting pos and start to be signed and putting back
> the casts. Unfortunately, the error value checks cannot be replaced with
> IS_ERR_VALUE() as long might be 32-bits.
>
> Fixes: 7097c96411d2 ("cachefiles: Fix __cachefiles_prepare_write()")
> Reported-by: Simon Horman <[email protected]>
> Reported-by: kernel test robot <[email protected]>
> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
> Signed-off-by: David Howells <[email protected]>
> Reviewed-by: Simon Horman <[email protected]>
> cc: Gao Xiang <[email protected]>
> cc: Yiqun Leng <[email protected]>
> cc: Jia Zhu <[email protected]>
> cc: Jeff Layton <[email protected]>
> cc: [email protected]
> cc: [email protected]
> cc: [email protected]
> cc: [email protected]

It looks good to me,
Reviewed-by: Gao Xiang <[email protected]>

Thanks,
Gao Xiang