diff options
author | Jeff Layton <jlayton@redhat.com> | 2013-02-06 08:28:55 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2013-02-08 15:19:10 -0500 |
commit | 4c190e2f913f038c9c91ee63b59cd037260ba353 (patch) | |
tree | fbb813220a57f4c8fbc110b933ff3698e67ec75d /include/linux/sunrpc | |
parent | de0b65ca55dc62b6b477f6e02088df2281da7b51 (diff) |
sunrpc: trim off trailing checksum before returning decrypted or integrity authenticated buffer
When GSSAPI integrity signatures are in use, or when we're using GSSAPI
privacy with the v2 token format, there is a trailing checksum on the
xdr_buf that is returned.
It's checked during the authentication stage, and afterward nothing
cares about it. Ordinarily, it's not a problem since the XDR code
generally ignores it, but it will be when we try to compute a checksum
over the buffer to help prevent XID collisions in the duplicate reply
cache.
Fix the code to trim off the checksums after verifying them. Note that
in unwrap_integ_data, we must avoid trying to reverify the checksum if
the request was deferred since it will no longer be present when it's
revisited.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Diffstat (limited to 'include/linux/sunrpc')
-rw-r--r-- | include/linux/sunrpc/xdr.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h index 224d06047e45..15f9204ee70b 100644 --- a/include/linux/sunrpc/xdr.h +++ b/include/linux/sunrpc/xdr.h | |||
@@ -152,6 +152,7 @@ xdr_adjust_iovec(struct kvec *iov, __be32 *p) | |||
152 | extern void xdr_shift_buf(struct xdr_buf *, size_t); | 152 | extern void xdr_shift_buf(struct xdr_buf *, size_t); |
153 | extern void xdr_buf_from_iov(struct kvec *, struct xdr_buf *); | 153 | extern void xdr_buf_from_iov(struct kvec *, struct xdr_buf *); |
154 | extern int xdr_buf_subsegment(struct xdr_buf *, struct xdr_buf *, unsigned int, unsigned int); | 154 | extern int xdr_buf_subsegment(struct xdr_buf *, struct xdr_buf *, unsigned int, unsigned int); |
155 | extern void xdr_buf_trim(struct xdr_buf *, unsigned int); | ||
155 | extern int xdr_buf_read_netobj(struct xdr_buf *, struct xdr_netobj *, unsigned int); | 156 | extern int xdr_buf_read_netobj(struct xdr_buf *, struct xdr_netobj *, unsigned int); |
156 | extern int read_bytes_from_xdr_buf(struct xdr_buf *, unsigned int, void *, unsigned int); | 157 | extern int read_bytes_from_xdr_buf(struct xdr_buf *, unsigned int, void *, unsigned int); |
157 | extern int write_bytes_to_xdr_buf(struct xdr_buf *, unsigned int, void *, unsigned int); | 158 | extern int write_bytes_to_xdr_buf(struct xdr_buf *, unsigned int, void *, unsigned int); |