Rewrite inline reply/call

Implement inline encoding and decoding of RPC replies, since those were
unimplemented before.

In doing so, I merged the inline and out-of-line encoding steps for both
call and reply, since we know how big everything is in advance.

I also had to change the amount grabbed for decoding, specifically we
grab five words (which is the amount we're guaranteed for replies) and
then three more later (to fill out the header for calls.)

This fixes one part of the layoutrecall bug reported by Boaz.

Signed-off-by: Adam C. Emerson <aemerson@linuxbox.com>
Signed-off-by: Matt Benjamin <matt@linuxbox.com>
Add missing 'break' in rpc_dplx_msg.c.

Found using Coverity, by Thomas Favre-Bulle
<thomas.favre-bulle@bull.net>

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
Notify clients on GSS context expiration.

1/ adds "endtime" to ctx (exactly as you do)
2/ fetches lifetime from gss_accept_sec_context.
3/ computes and returns RPCSEC_GSS_CTXPROBLEM similarly to what
        you do.  It does not call authgss_ctx_hash_del() - I think
        that should only happen upon a call to RPCSEC_GSS_DESTROY.
        It does set *no_dispatch.
It also
4/ modifies the result of svcauth_gss_validate() to return an error
        code instead of true/false.  That's not important in this patch,
        but if we want to push the lifetime check down here it could be.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
Fix return type of svcauth_gss_validate().

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
Fix memory leak from gss_get_mic.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
Use clock_gettime instead of time for Kerberos lifetime.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
Avoid use-after-free in svc_getreq_default.

Coverity CID 30416.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
Fix use-after_free in xdr_ioq_putbufs.

This was experimental code, but was unsafe.

Coverity CID 30408.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
Fix impossible use-after-free.

Coverity CID 30407.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
Remove unused ptr variable.

Coverity CID 30404.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
Avoid uninitialized AF conditional.

Coverity CID 30397.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
Clarify unconditional free call ctx.

Coverity CID 30381.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
Return RPCSEC_GSS_CREDPROBLEM on expiry.

Also, revert 5s expiration adjustment.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
Fix unlikely leak in clnt_vc_ncreate2.

If we failed to create a client handle, a buffer was leaked.

Coverity CID 30363.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
Fix unlikely netconfig handle leak.

If no transport types could be found, local_rpcb leaked a
netconfig handle.

Coverity CID 30365.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
Fix unlikely netconfig handle leak.

There were various error cases in __rpcbind_is_up which leaked
a netconfig handle.

Coverity CID 30366.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
Fix unlikely netpath session handle leak.

If a subsequent alloc failed, the handle was leaked.

Coverity CID 30370.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
Fix leaked UDP msg buffer in clnt_bcast error case.

The legacy code mixed allocation of a single msg buffer with
re-sizing the buffer, but only used it once.  Moved to the point
of use.

Coverity CID 30373.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
Fix unlikely netconf handle leak.

Coverity CID 30374.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
Fix unlikely rpc_gss_data leak in authgss_ncreate.

The object was leaked if a subsequent allocation failed.

Coverity CID 30362.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>