summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2010-03-16 13:30:44 +0000
committerGreg Kroah-Hartman <gregkh@suse.de>2010-04-01 16:02:09 -0700
commitf8adc4007d65d74f68c8ee3cbd4a068fc415580c (patch)
tree360b975b1a8deee81420098ce3bcf327c432408a /include
parent5dda8d1fc44f3ab37c0e5c8e980254b6703ef8b2 (diff)
netlink: fix unaligned access in nla_get_be64()
[ Upstream commit f5d410f2ea7ba340f11815a56e05b9fa9421c421 ] This patch fixes a unaligned access in nla_get_be64() that was introduced by myself in a17c859849402315613a0015ac8fbf101acf0cc1. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include')
-rw-r--r--include/net/netlink.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/net/netlink.h b/include/net/netlink.h
index a63b2192ac1c..668ad04a9171 100644
--- a/include/net/netlink.h
+++ b/include/net/netlink.h
@@ -945,7 +945,11 @@ static inline u64 nla_get_u64(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;
}
/**