linux-stable/net/dccp
Lin, Zhenpeng 40ea36ffa7 dccp: don't duplicate ccid when cloning dccp sock
commit d9ea761fdd upstream.

Commit 2677d20677 ("dccp: don't free ccid2_hc_tx_sock ...") fixed
a UAF but reintroduced CVE-2017-6074.

When the sock is cloned, two dccps_hc_tx_ccid will reference to the
same ccid. So one can free the ccid object twice from two socks after
cloning.

This issue was found by "Hadar Manor" as well and assigned with
CVE-2020-16119, which was fixed in Ubuntu's kernel. So here I port
the patch from Ubuntu to fix it.

The patch prevents cloned socks from referencing the same ccid.

Fixes: 2677d20677 ("dccp: don't free ccid2_hc_tx_sock ...")
Signed-off-by: Zhenpeng Lin <zplin@psu.edu>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-09-22 11:43:09 +02:00
..
ccids dccp: fix undefined behavior with 'cwnd' shift in ccid2_cwnd_restart() 2018-08-22 07:47:13 +02:00
Kconfig
Makefile
ackvec.c dccp: drop null test before destroy functions 2015-09-15 16:49:43 -07:00
ackvec.h
ccid.c dccp: drop null test before destroy functions 2015-09-15 16:49:43 -07:00
ccid.h dccp: fool proof ccid_hc_[rt]x_parse_options() 2019-02-12 19:44:59 +01:00
dccp.h dccp: add do-while-0 stubs for dccp_pr_debug macros 2021-08-26 08:37:27 -04:00
diag.c sock_diag: specify info_size per inet protocol 2015-06-15 19:49:22 -07:00
feat.c dccp: Fix memleak in __feat_register_sp 2020-01-23 08:19:34 +01:00
feat.h
input.c tcp/dccp: fix lockdep issue when SYN is backlogged 2018-10-18 09:13:23 +02:00
ipv4.c inet: stop leaking jiffies on the wire 2019-11-10 11:23:29 +01:00
ipv6.c ipv6: weaken the v4mapped source check 2021-04-07 12:05:38 +02:00
ipv6.h
minisocks.c dccp: don't duplicate ccid when cloning dccp sock 2021-09-22 11:43:09 +02:00
options.c dccp: do not assume DCCP code is non preemptible 2016-05-02 17:02:25 -04:00
output.c net: Generalise wq_has_sleeper helper 2015-11-30 14:47:33 -05:00
probe.c Use 64-bit timekeeping 2015-11-01 17:01:16 -05:00
proto.c dccp: don't free ccid2_hc_tx_sock struct in dccp_disconnect() 2018-06-13 16:16:41 +02:00
qpolicy.c
sysctl.c
timer.c dccp: fix tasklet usage 2018-05-19 10:26:57 +02:00