kernel_optimize_test/net/sctp
Marcelo Ricardo Leitner 951c6db954 sctp: fix memleak on err handling of stream initialization
syzbot reported a memory leak when an allocation fails within
genradix_prealloc() for output streams. That's because
genradix_prealloc() leaves initialized members initialized when the
issue happens and SCTP stack will abort the current initialization but
without cleaning up such members.

The fix here is to always call genradix_free() when genradix_prealloc()
fails, for output and also input streams, as it suffers from the same
issue.

Reported-by: syzbot+772d9e36c490b18d51d1@syzkaller.appspotmail.com
Fixes: 2075e50caf ("sctp: convert to genradix")
Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Tested-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-12-17 21:58:37 -08:00
..
associola.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-11-25 14:57:26 -08:00
auth.c sctp: add sctp_auth_init and sctp_auth_free 2019-08-19 18:27:29 -07:00
bind_addr.c
chunk.c sctp: add SCTP_SEND_FAILED_EVENT event 2019-10-09 17:06:58 -07:00
debug.c
diag.c net: annotate lockless accesses to sk->sk_max_ack_backlog 2019-11-06 16:14:48 -08:00
endpointola.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-11-25 14:57:26 -08:00
input.c sctp: cache netns in sctp_ep_common 2019-11-23 18:26:14 -08:00
inqueue.c
ipv6.c net: ipv6: add net argument to ip6_dst_lookup_flow 2019-12-04 12:27:12 -08:00
Kconfig
Makefile
objcnt.c
offload.c
output.c
outqueue.c
primitive.c
proc.c
protocol.c sctp: fully initialize v4 addr in some functions 2019-12-09 10:16:39 -08:00
sm_make_chunk.c net: sctp: Rename fallthrough label to unhandled 2019-10-11 09:26:05 -07:00
sm_sideeffect.c sctp: add support for Primary Path Switchover 2019-11-08 14:18:32 -08:00
sm_statefuns.c sctp: Fix memory leak in sctp_sf_do_5_2_4_dupcook 2019-11-23 18:20:17 -08:00
sm_statetable.c sctp: remove net sctp.x_enable working as a global switch 2019-08-19 18:27:29 -07:00
socket.c net: port < inet_prot_sock(net) --> inet_port_requires_bind_service(net, port) 2019-11-26 13:20:46 -08:00
stream_interleave.c
stream_sched_prio.c
stream_sched_rr.c
stream_sched.c
stream.c sctp: fix memleak on err handling of stream initialization 2019-12-17 21:58:37 -08:00
sysctl.c sctp: add support for Primary Path Switchover 2019-11-08 14:18:32 -08:00
transport.c sctp: only copy the available addr data in sctp_transport_init 2019-07-30 14:18:14 -07:00
tsnmap.c
ulpevent.c sctp: add SCTP_SEND_FAILED_EVENT event 2019-10-09 17:06:58 -07:00
ulpqueue.c