Commit f5d410f2 authored by Pablo Neira Ayuso's avatar Pablo Neira Ayuso Committed by David S. Miller

netlink: fix unaligned access in nla_get_be64()

This patch fixes a unaligned access in nla_get_be64() that was
introduced by myself in a17c8598.
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6830c25b
...@@ -945,7 +945,11 @@ static inline u64 nla_get_u64(const struct nlattr *nla) ...@@ -945,7 +945,11 @@ static inline u64 nla_get_u64(const struct nlattr *nla)
*/ */
static inline __be64 nla_get_be64(const struct nlattr *nla) static inline __be64 nla_get_be64(const struct nlattr *nla)
{ {
return *(__be64 *) nla_data(nla); __be64 tmp;
nla_memcpy(&tmp, nla, sizeof(tmp));
return tmp;
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment