Re: [PATCH 1/1] lockd: crashes in svcxdr_encode_owner

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

 



Hi Dai-

> On Sep 15, 2021, at 5:33 PM, Dai Ngo <dai.ngo@xxxxxxxxxx> wrote:
> 
> svcxdr_encode_owner needs to handle case where no lock owner
> info to pass back, obj->len == 0.
> 
> Fixes: a6a63ca5652e ("lockd: Common NLM XDR helpers")
> Signed-off-by: Dai Ngo <dai.ngo@xxxxxxxxxx>

This seems like 5.15-rc material, so I will apply it to my -rc branch
once review is complete.


> ---
> fs/lockd/svcxdr.h | 2 ++
> 1 file changed, 2 insertions(+)
> 
> diff --git a/fs/lockd/svcxdr.h b/fs/lockd/svcxdr.h
> index c69a0bb76c94..04fde20ea8c1 100644
> --- a/fs/lockd/svcxdr.h
> +++ b/fs/lockd/svcxdr.h
> @@ -139,6 +139,8 @@ svcxdr_encode_owner(struct xdr_stream *xdr, const struct xdr_netobj *obj)
> 
> 	if (xdr_stream_encode_u32(xdr, obj->len) < 0)
> 		return false;
> +	if (obj->len == 0)
> +		return true;
> 	p = xdr_reserve_space(xdr, obj->len);
> 	if (!p)
> 		return false;
> -- 
> 2.9.5
> 

--
Chuck Lever







[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux