]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
sunrpc: fix stripping of padded MIC tokens
authorTomáš Trnka <ttrnka@mail.muni.cz>
Fri, 20 May 2016 14:41:10 +0000 (16:41 +0200)
committerKamal Mostafa <kamal@canonical.com>
Fri, 10 Jun 2016 13:32:25 +0000 (06:32 -0700)
commit40f39d8743f389b16aa4f3847663b027170505b6
tree1c3763be7a94a373f1f5dea2a539cd9afca0d470
parentb520d20d2a4b88936a17f32f83ed846b55229b96
sunrpc: fix stripping of padded MIC tokens

BugLink: http://bugs.launchpad.net/bugs/1590455
commit c0cb8bf3a8e4bd82e640862cdd8891400405cb89 upstream.

The length of the GSS MIC token need not be a multiple of four bytes.
It is then padded by XDR to a multiple of 4 B, but unwrap_integ_data()
would previously only trim mic.len + 4 B. The remaining up to three
bytes would then trigger a check in nfs4svc_decode_compoundargs(),
leading to a "garbage args" error and mount failure:

nfs4svc_decode_compoundargs: compound not properly padded!
nfsd: failed to decode arguments!

This would prevent older clients using the pre-RFC 4121 MIC format
(37-byte MIC including a 9-byte OID) from mounting exports from v3.9+
servers using krb5i.

The trimming was introduced by commit 4c190e2f913f ("sunrpc: trim off
trailing checksum before returning decrypted or integrity authenticated
buffer").

Fixes: 4c190e2f913f "unrpc: trim off trailing checksum..."
Signed-off-by: Tomáš Trnka <ttrnka@mail.muni.cz>
Acked-by: Jeff Layton <jlayton@poochiereds.net>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
net/sunrpc/auth_gss/svcauth_gss.c