udplite: fix various data-races
authorEric Dumazet <edumazet@google.com>
Tue, 12 Sep 2023 09:17:30 +0000 (09:17 +0000)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 14 Sep 2023 14:16:36 +0000 (16:16 +0200)
commit882af43a0fc37e26d85fb0df0c9edd3bed928de4
tree285d545b88e7edfaa8c03073cad7e8f4ae1cf572
parent729549aa350c56a777bb342941ed4d69b6585769
udplite: fix various data-races

udp->pcflag, udp->pcslen and udp->pcrlen reads/writes are racy.

Move udp->pcflag to udp->udp_flags for atomicity,
and add READ_ONCE()/WRITE_ONCE() annotations for pcslen and pcrlen.

Fixes: ba4e58eca8aa ("[NET]: Supporting UDP-Lite (RFC 3828) in Linux")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
include/linux/udp.h
include/net/udplite.h
net/ipv4/udp.c
net/ipv6/udp.c