]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
dccp: fix data-race around dp->dccps_mss_cache
authorEric Dumazet <edumazet@google.com>
Thu, 3 Aug 2023 16:30:21 +0000 (16:30 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Aug 2023 16:22:01 +0000 (18:22 +0200)
commitf239c9e1d98b313435481b4926e8bdd06197e4d8
treecd180aebd64ba73632d86c6c74cbfe53de66cc87
parent49a1fee22fae61cae56b22332c1e34d08dba6f55
dccp: fix data-race around dp->dccps_mss_cache

commit a47e598fbd8617967e49d85c49c22f9fc642704c upstream.

dccp_sendmsg() reads dp->dccps_mss_cache before locking the socket.
Same thing in do_dccp_getsockopt().

Add READ_ONCE()/WRITE_ONCE() annotations,
and change dccp_sendmsg() to check again dccps_mss_cache
after socket is locked.

Fixes: 7c657876b63c ("[DCCP]: Initial implementation")
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/20230803163021.2958262-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/dccp/output.c
net/dccp/proto.c