summaryrefslogtreecommitdiffstats
path: root/net/sunrpc/auth_gss/gss_rpc_xdr.c
Commit message (Collapse)AuthorAgeFilesLines
* svcrpc: fix potential GSSX_ACCEPT_SEC_CONTEXT decoding failuresScott Mayhew2015-05-041-7/+16
| | | | | | | | | | | | | | | In an environment where the KDC is running Active Directory, the exported composite name field returned in the context could be large enough to span a page boundary. Attaching a scratch buffer to the decoding xdr_stream helps deal with those cases. The case where we saw this was actually due to behavior that's been fixed in newer gss-proxy versions, but we're fixing it here too. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Cc: stable@vger.kernel.org Reviewed-by: Simo Sorce <simo@redhat.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* svcrpc: handle some gssproxy encoding errorsJ. Bruce Fields2013-10-101-15/+14
| | | | | Reported-by: Andi Kleen <andi@firstfloor.org> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* rpc: fix huge kmalloc's in gss-proxyJ. Bruce Fields2013-09-061-0/+3
| | | | | | | | | | The reply to a gssproxy can include up to NGROUPS_MAX gid's, which will take up more than a page. We therefore need to allocate an array of pages to hold the reply instead of trying to allocate a single huge buffer. Tested-by: Simo Sorce <simo@redhat.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* rpc: comment on linux_cred encoding, treat all as unsignedJ. Bruce Fields2013-09-061-8/+10
| | | | | | | | | | | | The encoding of linux creds is a bit confusing. Also: I think in practice it doesn't really matter whether we treat any of these things as signed or unsigned, but unsigned seems more straightforward: uid_t/gid_t are unsigned and it simplifies the ngroups overflow check. Tested-by: Simo Sorce <simo@redhat.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* rpc: clean up decoding of gssproxy linux credsJ. Bruce Fields2013-09-061-19/+13
| | | | | | | | | | | | | | | | We can use the normal coding infrastructure here. Two minor behavior changes: - we're assuming no wasted space at the end of the linux cred. That seems to match gss-proxy's behavior, and I can't see why it would need to do differently in the future. - NGROUPS_MAX check added: note groups_alloc doesn't do this, this is the caller's responsibility. Tested-by: Simo Sorce <simo@redhat.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* svcrpc: fix gss-proxy xdr decoding oopsJ. Bruce Fields2013-08-011-4/+5
| | | | | | | | | | Uninitialized stack data was being used as the destination for memcpy's. Longer term we'll just delete some of this code; all we're doing is skipping over xdr that we don't care about. Cc: stable@vger.kernel.org Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* SUNRPC: fix decoding of optional gss-proxy xdr fieldsJ. Bruce Fields2013-05-071-13/+13
| | | | | | | | The current code works, but sort of by accident: it obviously didn't intend the error return to be interpreted as "true". Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* SUNRPC: Refactor gssx_dec_option_array() to kill uninitialized warningGeert Uytterhoeven2013-05-061-15/+17
| | | | | | | | | | | net/sunrpc/auth_gss/gss_rpc_xdr.c: In function ‘gssx_dec_option_array’: net/sunrpc/auth_gss/gss_rpc_xdr.c:258: warning: ‘creds’ may be used uninitialized in this function Return early if count is zero, to make it clearer to the compiler (and the casual reviewer) that no more processing is done. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* svcrpc: fix gss-proxy to respect user namespacesJ. Bruce Fields2013-04-291-7/+13
| | | | Signed-off-by: J. Bruce Fields <bfields@redhat.com>
* SUNRPC: Add RPC based upcall mechanism for RPCGSS authSimo Sorce2013-04-261-0/+832
This patch implements a sunrpc client to use the services of the gssproxy userspace daemon. In particular it allows to perform calls in user space using an RPC call instead of custom hand-coded upcall/downcall messages. Currently only accept_sec_context is implemented as that is all is needed for the server case. File server modules like NFS and CIFS can use full gssapi services this way, once init_sec_context is also implemented. For the NFS server case this code allow to lift the limit of max 2k krb5 tickets. This limit is prevents legitimate kerberos deployments from using krb5 authentication with the Linux NFS server as they have normally ticket that are many kilobytes large. It will also allow to lift the limitation on the size of the credential set (uid,gid,gids) passed down from user space for users that have very many groups associated. Currently the downcall mechanism used by rpc.svcgssd is limited to around 2k secondary groups of the 65k allowed by kernel structures. Signed-off-by: Simo Sorce <simo@redhat.com> [bfields: containerization, concurrent upcalls, misc. fixes and cleanup] Signed-off-by: J. Bruce Fields <bfields@redhat.com>