diff options
author | Xin Long <lucien.xin@gmail.com> | 2018-12-01 01:36:59 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-12-03 15:54:41 -0800 |
commit | fb6df5a6234c38a9c551559506a49a677ac6f07a (patch) | |
tree | 7411e479d478cf378f65a2b23fbf8bb81747ed37 /net/sctp/sysctl.c | |
parent | 986103e7920cabc0b910749e77ae5589d3934d52 (diff) | |
download | linux-fb6df5a6234c38a9c551559506a49a677ac6f07a.tar.bz2 |
sctp: kfree_rcu asoc
In sctp_hash_transport/sctp_epaddr_lookup_transport, it dereferences
a transport's asoc under rcu_read_lock while asoc is freed not after
a grace period, which leads to a use-after-free panic.
This patch fixes it by calling kfree_rcu to make asoc be freed after
a grace period.
Note that only the asoc's memory is delayed to free in the patch, it
won't cause sk to linger longer.
Thanks Neil and Marcelo to make this clear.
Fixes: 7fda702f9315 ("sctp: use new rhlist interface on sctp transport rhashtable")
Fixes: cd2b70875058 ("sctp: check duplicate node before inserting a new transport")
Reported-by: syzbot+0b05d8aa7cb185107483@syzkaller.appspotmail.com
Reported-by: syzbot+aad231d51b1923158444@syzkaller.appspotmail.com
Suggested-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/sysctl.c')
0 files changed, 0 insertions, 0 deletions