History

SUNRPC: Use struct xdr_stream when decoding RPC Reply header

Modernize and harden the code path that parses an RPC Reply message.

Chuck Lever committed 7 years ago

Commit a0584ee1 parent 7f5667a7 files · +243 −201Browse files

Showing the changes to include/linux (2 of 7 files). Show all

Unified · Split

2 files
  1. include/linux/sunrpc/auth.h +10 −5
  2. include/linux/sunrpc/xdr.h +1 −0
include/linux/sunrpc/auth.h+10−5
@@ -134,11 +134,12 @@ struct rpc_credops { · 133 unmodified lines
134 int (*crmarshal)(struct rpc_task *task,134 int (*crmarshal)(struct rpc_task *task,
135 struct xdr_stream *xdr);135 struct xdr_stream *xdr);
136 int (*crrefresh)(struct rpc_task *);136 int (*crrefresh)(struct rpc_task *);
137 __be32 * (*crvalidate)(struct rpc_task *, __be32 *);137 int (*crvalidate)(struct rpc_task *task,
138 struct xdr_stream *xdr);
138 int (*crwrap_req)(struct rpc_task *task,139 int (*crwrap_req)(struct rpc_task *task,
139 struct xdr_stream *xdr);140 struct xdr_stream *xdr);
140 int (*crunwrap_resp)(struct rpc_task *, kxdrdproc_t,141 int (*crunwrap_resp)(struct rpc_task *task,
141 void *, __be32 *, void *);142 struct xdr_stream *xdr);
142 int (*crkey_timeout)(struct rpc_cred *);143 int (*crkey_timeout)(struct rpc_cred *);
143 char * (*crstringify_acceptor)(struct rpc_cred *);144 char * (*crstringify_acceptor)(struct rpc_cred *);
144 bool (*crneed_reencode)(struct rpc_task *);145 bool (*crneed_reencode)(struct rpc_task *);
@@ -168,12 +169,16 @@ struct rpc_cred * rpcauth_lookupcred(struct rpc_auth *, int); · 23 unmodified lines
168void put_rpccred(struct rpc_cred *);169void put_rpccred(struct rpc_cred *);
169int rpcauth_marshcred(struct rpc_task *task,170int rpcauth_marshcred(struct rpc_task *task,
170 struct xdr_stream *xdr);171 struct xdr_stream *xdr);
171__be32 * rpcauth_checkverf(struct rpc_task *, __be32 *);172int rpcauth_checkverf(struct rpc_task *task,
173 struct xdr_stream *xdr);
172int rpcauth_wrap_req_encode(struct rpc_task *task,174int rpcauth_wrap_req_encode(struct rpc_task *task,
173 struct xdr_stream *xdr);175 struct xdr_stream *xdr);
174int rpcauth_wrap_req(struct rpc_task *task,176int rpcauth_wrap_req(struct rpc_task *task,
175 struct xdr_stream *xdr);177 struct xdr_stream *xdr);
176int rpcauth_unwrap_resp(struct rpc_task *task, kxdrdproc_t decode, void *rqstp, __be32 *data, void *obj);178int rpcauth_unwrap_resp_decode(struct rpc_task *task,
179 struct xdr_stream *xdr);
180int rpcauth_unwrap_resp(struct rpc_task *task,
181 struct xdr_stream *xdr);
177bool rpcauth_xmit_need_reencode(struct rpc_task *task);182bool rpcauth_xmit_need_reencode(struct rpc_task *task);
178int rpcauth_refreshcred(struct rpc_task *);183int rpcauth_refreshcred(struct rpc_task *);
179void rpcauth_invalcred(struct rpc_task *);184void rpcauth_invalcred(struct rpc_task *);
include/linux/sunrpc/xdr.h+1−0
@@ -89,6 +89,7 @@ xdr_buf_init(struct xdr_buf *buf, void *start, size_t len) · 88 unmodified lines
89 89
90#define rpc_auth_null cpu_to_be32(RPC_AUTH_NULL)90#define rpc_auth_null cpu_to_be32(RPC_AUTH_NULL)
91#define rpc_auth_unix cpu_to_be32(RPC_AUTH_UNIX)91#define rpc_auth_unix cpu_to_be32(RPC_AUTH_UNIX)
92#define rpc_auth_short cpu_to_be32(RPC_AUTH_SHORT)
92#define rpc_auth_gss cpu_to_be32(RPC_AUTH_GSS)93#define rpc_auth_gss cpu_to_be32(RPC_AUTH_GSS)
93 94
94#define rpc_call cpu_to_be32(RPC_CALL)95#define rpc_call cpu_to_be32(RPC_CALL)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t