Skip to content

Commit e6f268e

Browse files
committed
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: 35c5845 ("net: Add helpers for 64-bit aligning netlink attributes.") Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent cca1d81 commit e6f268e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/net/netlink.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1250,7 +1250,7 @@ static inline int nla_align_64bit(struct sk_buff *skb, int padattr)
12501250
* nlattr header for next attribute, will make nla_data()
12511251
* 8-byte aligned.
12521252
*/
1253-
if (IS_ALIGNED((unsigned long)skb->data, 8) &&
1253+
if (IS_ALIGNED((unsigned long)skb_tail_pointer(skb), 8) &&
12541254
!nla_reserve(skb, padattr, 0))
12551255
return -EMSGSIZE;
12561256
#endif

0 commit comments

Comments
 (0)