Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fde0133b authored by Nathaniel W Filardo's avatar Nathaniel W Filardo Committed by David S. Miller
Browse files

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: default avatarNathaniel Wesley Filardo <nwf@cs.jhu.edu>
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6e14a5ee
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;