summaryrefslogtreecommitdiffstats
path: root/net/sunrpc/auth_gss/gss_krb5_unseal.c
diff options
context:
space:
mode:
authorJames Ettle2018-01-28 21:34:16 +0100
committerJ. Bruce Fields2018-03-19 21:38:12 +0100
commit90a9b1473df72a8b356e7ad6c9b9c9608927b103 (patch)
treef93591d97a95bcfc206d8cdc2691a7cfc36a2040 /net/sunrpc/auth_gss/gss_krb5_unseal.c
parentnfsd: remove blocked locks on client teardown (diff)
downloadkernel-qcow2-linux-90a9b1473df72a8b356e7ad6c9b9c9608927b103.tar.gz
kernel-qcow2-linux-90a9b1473df72a8b356e7ad6c9b9c9608927b103.tar.xz
kernel-qcow2-linux-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_unseal.c')
-rw-r--r--net/sunrpc/auth_gss/gss_krb5_unseal.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/sunrpc/auth_gss/gss_krb5_unseal.c b/net/sunrpc/auth_gss/gss_krb5_unseal.c
index dcf9515d9aef..b601a73cc9db 100644
--- a/net/sunrpc/auth_gss/gss_krb5_unseal.c
+++ b/net/sunrpc/auth_gss/gss_krb5_unseal.c
@@ -155,10 +155,12 @@ gss_verify_mic_v2(struct krb5_ctx *ctx,
u8 flags;
int i;
unsigned int cksum_usage;
+ __be16 be16_ptr;
dprintk("RPC: %s\n", __func__);
- if (be16_to_cpu(*((__be16 *)ptr)) != KG2_TOK_MIC)
+ memcpy(&be16_ptr, (char *) ptr, 2);
+ if (be16_to_cpu(be16_ptr) != KG2_TOK_MIC)
return GSS_S_DEFECTIVE_TOKEN;
flags = ptr[2];