linux-stable/net/sctp
NeilBrown 611d93fbea net: fix iteration for sctp transport seq_files
commit af8085f3a4 upstream.

The sctp transport seq_file iterators take a reference to the transport
in the ->start and ->next functions and releases the reference in the
->show function.  The preferred handling for such resources is to
release them in the subsequent ->next or ->stop function call.

Since Commit 1f4aace60b ("fs/seq_file.c: simplify seq_file iteration
code and interface") there is no guarantee that ->show will be called
after ->next, so this function can now leak references.

So move the sctp_transport_put() call to ->next and ->stop.

Fixes: 1f4aace60b ("fs/seq_file.c: simplify seq_file iteration code and interface")
Reported-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-17 10:35:19 +01:00
..
associola.c
auth.c sctp: fix sctp_auth_init_hmacs() error path 2020-10-14 10:33:01 +02:00
bind_addr.c
chunk.c
debug.c
diag.c
endpointola.c
input.c sctp: change to hold/put transport for proto_unreach_timer 2020-11-24 13:28:59 +01:00
inqueue.c
ipv6.c
Kconfig
Makefile
objcnt.c
offload.c
output.c
outqueue.c sctp: move trace_sctp_probe_path into sctp_outq_sack 2020-10-01 13:17:27 +02:00
primitive.c
proc.c net: fix iteration for sctp transport seq_files 2021-02-17 10:35:19 +01:00
protocol.c
sm_make_chunk.c
sm_sideeffect.c sctp: change to hold/put transport for proto_unreach_timer 2020-11-24 13:28:59 +01:00
sm_statefuns.c
sm_statetable.c
socket.c net, sctp, filter: remap copy_from_user failure error 2021-01-23 15:58:00 +01:00
stream.c net: sctp: Fix negotiation of the number of data streams. 2020-09-03 11:26:40 +02:00
stream_interleave.c
stream_sched.c
stream_sched_prio.c
stream_sched_rr.c
sysctl.c
transport.c sctp: change to hold/put transport for proto_unreach_timer 2020-11-24 13:28:59 +01:00
tsnmap.c
ulpevent.c
ulpqueue.c