umber-kernel/include/linux/sunrpc
Chuck Lever b633683dc0 xdrgen: Initialize data pointer for zero-length items
[ Upstream commit 27b0fcae8f535fb882b1876227a935dcfdf576aa ]

The xdrgen decoders for strings and opaque data had an
optimization that skipped calling xdr_inline_decode() when the
item length was zero. This left the data pointer uninitialized,
which could lead to unpredictable behavior when callers access
it.

Remove the zero-length check and always call xdr_inline_decode().
When passed a length of zero, xdr_inline_decode() returns the
current buffer position, which is valid and matches the behavior
of hand-coded XDR decoders throughout the kernel.

Fixes: 4b132aacb0 ("tools: Add xdrgen")
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2026-02-26 14:59:18 -08:00
..
xdrgen xdrgen: Initialize data pointer for zero-length items 2026-02-26 14:59:18 -08:00
addr.h
auth.h
auth_gss.h
bc_xprt.h
cache.h
clnt.h
debug.h sunrpc: add a Kconfig option to redirect dfprintk() output to trace buffer 2025-09-23 13:28:19 -04:00
gss_api.h
gss_err.h
gss_krb5.h
metrics.h
msg_prot.h
rdma_rn.h
rpc_pipe_fs.h
rpc_rdma.h
rpc_rdma_cid.h
sched.h
stats.h
svc.h SUNRPC: Update svcxdr_init_decode() to call xdr_set_scratch_folio() 2025-09-23 13:29:50 -04:00
svc_rdma.h
svc_rdma_pcl.h
svc_xprt.h SUNRPC: Move the svc_rpcb_cleanup() call sites 2025-09-23 13:28:19 -04:00
svcauth.h
svcauth_gss.h
svcsock.h
timer.h
types.h
xdr.h NFSD 6.18 Release Notes 2025-10-06 13:22:21 -07:00
xprt.h
xprtmultipath.h
xprtrdma.h
xprtsock.h