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:14:42 +0000 (13:14 +0100)
commit222cc04356984f3f98acfa756a69d4bed7c501ac
treed5172f42856629da0c6e06cd39343af537a537de
parent8a3b0237107a85ae3aa105a340d155c24b793192
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