From: Nathaniel W Filardo Date: Thu, 15 May 2014 14:51:22 +0000 (+0100) Subject: af_rxrpc: Fix XDR length check in rxrpc key demarshalling. X-Git-Tag: v4.9.8~6360^2~24 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fde0133b9cfa4e01b275e942ffc32fd78e27d27c;p=platform%2Fkernel%2Flinux-rpi3.git af_rxrpc: Fix XDR length check in rxrpc key demarshalling. There may be padding on the ticket contained in the key payload, so just ensure that the claimed token length is large enough, rather than exactly the right size. Signed-off-by: Nathaniel Wesley Filardo Signed-off-by: David Howells Signed-off-by: David S. Miller --- diff --git a/net/rxrpc/ar-key.c b/net/rxrpc/ar-key.c index 7633a75..0ad0807 100644 --- a/net/rxrpc/ar-key.c +++ b/net/rxrpc/ar-key.c @@ -99,7 +99,7 @@ static int rxrpc_instantiate_xdr_rxkad(struct key *key, const __be32 *xdr, _debug("tktlen: %x", tktlen); if (tktlen > AFSTOKEN_RK_TIX_MAX) return -EKEYREJECTED; - if (8 * 4 + tktlen != toklen) + if (toklen < 8 * 4 + tktlen) return -EKEYREJECTED; plen = sizeof(*token) + sizeof(*token->kad) + tktlen;