diff options
author | James Ettle <james@ettle.org.uk> | 2018-01-28 20:34:16 +0000 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2018-03-19 16:38:12 -0400 |
commit | 90a9b1473df72a8b356e7ad6c9b9c9608927b103 (patch) | |
tree | f93591d97a95bcfc206d8cdc2691a7cfc36a2040 /net/sunrpc/auth_gss/gss_krb5_seal.c | |
parent | 68ef3bc3166468678d5e1fdd216628c35bd1186f (diff) | |
download | lwn-90a9b1473df72a8b356e7ad6c9b9c9608927b103.tar.gz lwn-90a9b1473df72a8b356e7ad6c9b9c9608927b103.zip |
sunrpc: Fix unaligned access on sparc64
Fix unaligned access in gss_{get,verify}_mic_v2() on sparc64
Signed-off-by: James Ettle <james@ettle.org.uk>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'net/sunrpc/auth_gss/gss_krb5_seal.c')
-rw-r--r-- | net/sunrpc/auth_gss/gss_krb5_seal.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/sunrpc/auth_gss/gss_krb5_seal.c b/net/sunrpc/auth_gss/gss_krb5_seal.c index 1d74d653e6c0..94a2b3f082a8 100644 --- a/net/sunrpc/auth_gss/gss_krb5_seal.c +++ b/net/sunrpc/auth_gss/gss_krb5_seal.c @@ -177,6 +177,7 @@ gss_get_mic_v2(struct krb5_ctx *ctx, struct xdr_buf *text, u64 seq_send; u8 *cksumkey; unsigned int cksum_usage; + __be64 seq_send_be64; dprintk("RPC: %s\n", __func__); @@ -187,7 +188,9 @@ gss_get_mic_v2(struct krb5_ctx *ctx, struct xdr_buf *text, spin_lock(&krb5_seq_lock); seq_send = ctx->seq_send64++; spin_unlock(&krb5_seq_lock); - *((__be64 *)(krb5_hdr + 8)) = cpu_to_be64(seq_send); + + seq_send_be64 = cpu_to_be64(seq_send); + memcpy(krb5_hdr + 8, (char *) &seq_send_be64, 8); if (ctx->initiate) { cksumkey = ctx->initiator_sign; |