mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 03:40:35 +09:00
dccp/tcp: do not inherit mc_list from parent
[ Upstream commit657831ffc3] syzkaller found a way to trigger double frees from ip_mc_drop_socket() It turns out that leave a copy of parent mc_list at accept() time, which is very bad. Very similar to commit8b485ce698("tcp: do not inherit fastopen_req from parent") Initial report from Pray3r, completed by Andrey one. Thanks a lot to them ! Signed-off-by: Eric Dumazet <edumazet@google.com> Reported-by: Pray3r <pray3r.z@gmail.com> Reported-by: Andrey Konovalov <andreyknvl@google.com> Tested-by: Andrey Konovalov <andreyknvl@google.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
b9978c2745
commit
5f67a1663c
@@ -669,6 +669,8 @@ struct sock *inet_csk_clone_lock(const struct sock *sk,
|
||||
inet_sk(newsk)->inet_sport = htons(inet_rsk(req)->ir_num);
|
||||
newsk->sk_write_space = sk_stream_write_space;
|
||||
|
||||
inet_sk(newsk)->mc_list = NULL;
|
||||
|
||||
newsk->sk_mark = inet_rsk(req)->ir_mark;
|
||||
atomic64_set(&newsk->sk_cookie,
|
||||
atomic64_read(&inet_rsk(req)->ir_cookie));
|
||||
|
||||
Reference in New Issue
Block a user