netlink: reset extack earlier in netlink_rcv_skb
authorXin Long <lucien.xin@gmail.com>
Thu, 18 Jan 2018 06:48:03 +0000 (14:48 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 18 Jan 2018 20:14:51 +0000 (15:14 -0500)
commitcd443f1e91ca600a092e780e8250cd6a2954b763
treef76635f6578e3aaab43c44704889cbc27b788220
parent7155f8f391576f133ed26c8d6bb8c7f03ceb404a
netlink: reset extack earlier in netlink_rcv_skb

Move up the extack reset/initialization in netlink_rcv_skb, so that
those 'goto ack' will not skip it. Otherwise, later on netlink_ack
may use the uninitialized extack and cause kernel crash.

Fixes: cbbdf8433a5f ("netlink: extack needs to be reset each time through loop")
Reported-by: syzbot+03bee3680a37466775e7@syzkaller.appspotmail.com
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/netlink/af_netlink.c