diff options
author | David S. Miller <davem@davemloft.net> | 2016-04-20 15:32:54 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-04-20 15:32:54 -0400 |
commit | e6f268ef3687862b0e9f01f7b3706b54f75b82ab (patch) | |
tree | 6884a1cc212054143742fd2efbd16a86bac9ff92 | |
parent | cca1d81574d266d4a3aa33f3947297564525e127 (diff) | |
download | lwn-e6f268ef3687862b0e9f01f7b3706b54f75b82ab.tar.gz lwn-e6f268ef3687862b0e9f01f7b3706b54f75b82ab.zip |
net: nla_align_64bit() needs to test the right pointer.
Netlink messages are appended, one object at a time, to the end of
the SKB. Therefore we need to test skb_tail_pointer() not skb->data
for alignment.
Fixes: 35c5845957c7 ("net: Add helpers for 64-bit aligning netlink attributes.")
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/net/netlink.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/netlink.h b/include/net/netlink.h index cf95df1fa14b..3c1fd92a52c8 100644 --- a/include/net/netlink.h +++ b/include/net/netlink.h @@ -1250,7 +1250,7 @@ static inline int nla_align_64bit(struct sk_buff *skb, int padattr) * nlattr header for next attribute, will make nla_data() * 8-byte aligned. */ - if (IS_ALIGNED((unsigned long)skb->data, 8) && + if (IS_ALIGNED((unsigned long)skb_tail_pointer(skb), 8) && !nla_reserve(skb, padattr, 0)) return -EMSGSIZE; #endif |