diff options
author | Eric Dumazet <edumazet@google.com> | 2023-09-12 09:17:23 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-11-20 11:58:55 +0100 |
commit | 06de37fc9c6a7339e30cff0aafcb7675184f84cd (patch) | |
tree | 053b8b7f59fb04aed072c7b0b7a4b9ee3b481e79 /net/ipv4 | |
parent | 39fc39a0c5907a07b8505f73b11532b72ed6e9c4 (diff) | |
download | linux-stable-06de37fc9c6a7339e30cff0aafcb7675184f84cd.tar.gz linux-stable-06de37fc9c6a7339e30cff0aafcb7675184f84cd.tar.bz2 linux-stable-06de37fc9c6a7339e30cff0aafcb7675184f84cd.zip |
udp: move udp->no_check6_rx to udp->udp_flags
[ Upstream commit bcbc1b1de884647aa0318bf74eb7f293d72a1e40 ]
syzbot reported that udp->no_check6_rx can be read locklessly.
Use one atomic bit from udp->udp_flags.
Fixes: 1c19448c9ba6 ("net: Make enabling of zero UDP6 csums more restrictive")
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/udp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 0c6998291c99..cb32826a1db2 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -2698,7 +2698,7 @@ int udp_lib_setsockopt(struct sock *sk, int level, int optname, break; case UDP_NO_CHECK6_RX: - up->no_check6_rx = valbool; + udp_set_no_check6_rx(sk, valbool); break; case UDP_SEGMENT: @@ -2795,7 +2795,7 @@ int udp_lib_getsockopt(struct sock *sk, int level, int optname, break; case UDP_NO_CHECK6_RX: - val = up->no_check6_rx; + val = udp_get_no_check6_rx(sk); break; case UDP_SEGMENT: |