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)
committerDavid S. Miller <davem@davemloft.net>
Wed, 16 Nov 2022 12:48:44 +0000 (12:48 +0000)
commitcb34b7cf17ecf33499c9298943f85af247abc1e9
treeaf00604bc36b109ae88bae9d753a530c529528f2
parent6c1c5097781f563b70a81683ea6fdac21637573b
ipv6/sit: use DEV_STATS_INC() to avoid data-races

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>
net/ipv6/sit.c