]> 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:10:54 +0000 (18:10 +0200)
commit162fa1e3cfb62aa780d7c40c8cccb6c2f8bef7c1
treeb5a67dac33668726eac8479ecc7d94e037617d7d
parent5e54faf9295971ea6132b917e9c7faa3384c8ed8
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