Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e6f268ef authored by David S. Miller's avatar David S. Miller
Browse files

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: 35c58459 ("net: Add helpers for 64-bit aligning netlink attributes.")
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent cca1d815
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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