• Chuck Lever's avatar
    SUNRPC: Add an XDR decoding helper for struct opaque_auth · 846b5756
    Chuck Lever authored
    RFC 5531 defines the body of an RPC Call message like this:
    
    	struct call_body {
    		unsigned int rpcvers;
    		unsigned int prog;
    		unsigned int vers;
    		unsigned int proc;
    		opaque_auth cred;
    		opaque_auth verf;
    		/* procedure-specific parameters start here */
    	};
    
    In the current server code, decoding a struct opaque_auth type is
    open-coded in several places, and is thus difficult to harden
    everywhere.
    
    Introduce a helper for decoding an opaque_auth within the context
    of a xdr_stream. This helper can be shared with all authentication
    flavor implemenations, even on the client-side.
    
    Done as part of hardening the server-side RPC header decoding paths.
    Reviewed-by: default avatarJeff Layton <jlayton@kernel.org>
    Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
    846b5756
xdr.c 58.4 KB