ipv6/sit: use DEV_STATS_INC() to avoid data-races
authorEric Dumazet <edumazet@google.com>
Tue, 15 Nov 2022 08:53:56 +0000 (08:53 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:33:02 +0000 (13:33 +0100)
commit207501a986831174df09a36a8cb62a28f92f0dc8
treeaa972536715fa46bab9b4bf2e530a130bd9bf3d4
parent9921d1b68c46ae1926e634d21dc3d2103f4310fd
ipv6/sit: use DEV_STATS_INC() to avoid data-races

[ Upstream commit cb34b7cf17ecf33499c9298943f85af247abc1e9 ]

syzbot/KCSAN reported that multiple cpus are updating dev->stats.tx_error
concurrently.

This is because sit tunnels are NETIF_F_LLTX, meaning their ndo_start_xmit()
is not protected by a spinlock.

While original KCSAN report was about tx path, rx path has the same issue.

Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/ipv6/sit.c