netlink: Use netlink header as base to calculate bad attribute offset
authorPablo Neira Ayuso <pablo@netfilter.org>
Wed, 26 Feb 2020 18:47:34 +0000 (19:47 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Mar 2020 06:14:12 +0000 (07:14 +0100)
commit7aa760f0f545dc859d1f273e6d52dfac4c07f45e
tree56fe8df5715661ff671e4ae245999a686620523e
parent53e404eddda4044c5a005a27a55e06037de7408c
netlink: Use netlink header as base to calculate bad attribute offset

[ Upstream commit 84b3268027641401bb8ad4427a90a3cce2eb86f5 ]

Userspace might send a batch that is composed of several netlink
messages. The netlink_ack() function must use the pointer to the netlink
header as base to calculate the bad attribute offset.

Fixes: 2d4bc93368f5 ("netlink: extended ACK reporting")
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@linuxfoundation.org>
net/netlink/af_netlink.c