macsec: use DEV_STATS_INC()
authorEric Dumazet <edumazet@google.com>
Fri, 4 Aug 2023 17:26:52 +0000 (17:26 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 6 Aug 2023 12:19:57 +0000 (13:19 +0100)
commit32d0a49d36a2a306c2e47fe5659361e424f0ed3f
tree384e9dedc57d8f3c340f0bbab21da061df721c19
parent6b47808f223c70ff564f9b363446d2a5fa1e05b2
macsec: use DEV_STATS_INC()

syzbot/KCSAN reported data-races in macsec whenever dev->stats fields
are updated.

It appears all of these updates can happen from multiple cpus.

Adopt SMP safe DEV_STATS_INC() to update dev->stats fields.

Fixes: c09440f7dcb3 ("macsec: introduce IEEE 802.1AE driver")
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/macsec.c