netlink: extack needs to be reset each time through loop
authorDavid Ahern <dsahern@gmail.com>
Wed, 10 Jan 2018 21:00:39 +0000 (13:00 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Jan 2018 13:03:48 +0000 (14:03 +0100)
commit3eae0ba8c9b51d83d2293249fb9c82e90fc6dc31
treef74729a4feb29b05b282523d54013fafecb61055
parent3c6e5f2f5ef11bdba41e8158cc3c3e8ee6cfd198
netlink: extack needs to be reset each time through loop

[ Upstream commit cbbdf8433a5f117b1a2119ea30fc651b61ef7570 ]

syzbot triggered the WARN_ON in netlink_ack testing the bad_attr value.
The problem is that netlink_rcv_skb loops over the skb repeatedly invoking
the callback and without resetting the extack leaving potentially stale
data. Initializing each time through avoids the WARN_ON.

Fixes: 2d4bc93368f5a ("netlink: extended ACK reporting")
Reported-by: syzbot+315fa6766d0f7c359327@syzkaller.appspotmail.com
Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/netlink/af_netlink.c