TencentOS-kernel/net/sctp
NeilBrown 7b61382802 net: fix iteration for sctp transport seq_files
commit af8085f3a4712c57d0dd415ad543bac85780375c 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 1f4aace60b0e ("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: 1f4aace60b0e ("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-04-12 12:52:06 +08:00
..
Kconfig Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
Makefile Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
associola.c sctp: Don't advertise IPv4 addresses if ipv6only is set on the socket 2021-03-16 16:30:47 +08:00
auth.c sctp: fix sctp_auth_init_hmacs() error path 2021-03-16 16:38:00 +08:00
bind_addr.c sctp: Don't advertise IPv4 addresses if ipv6only is set on the socket 2021-03-16 16:30:47 +08:00
chunk.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
debug.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
diag.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
endpointola.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
input.c sctp: change to hold/put transport for proto_unreach_timer 2021-03-16 16:41:08 +08:00
inqueue.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
ipv6.c sctp: fix possibly using a bad saddr with a given dst 2021-03-16 16:28:59 +08:00
objcnt.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
offload.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
output.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
outqueue.c sctp: move trace_sctp_probe_path into sctp_outq_sack 2021-03-16 16:36:46 +08:00
primitive.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
proc.c net: fix iteration for sctp transport seq_files 2021-04-12 12:52:06 +08:00
protocol.c sctp: Don't advertise IPv4 addresses if ipv6only is set on the socket 2021-03-16 16:30:47 +08:00
sm_make_chunk.c sctp: Fix SHUTDOWN CTSN Ack in the peer restart case 2021-03-16 16:27:29 +08:00
sm_sideeffect.c sctp: change to hold/put transport for proto_unreach_timer 2021-03-16 16:41:08 +08:00
sm_statefuns.c sctp: Start shutdown on association restart if in SHUTDOWN-SENT state and socket is closed 2021-03-16 16:28:25 +08:00
sm_statetable.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
socket.c net, sctp, filter: remap copy_from_user failure error 2021-04-12 12:51:31 +08:00
stream.c net: sctp: Fix negotiation of the number of data streams. 2021-03-16 16:34:44 +08:00
stream_interleave.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
stream_sched.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
stream_sched_prio.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
stream_sched_rr.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sysctl.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
transport.c sctp: change to hold/put transport for proto_unreach_timer 2021-03-16 16:41:08 +08:00
tsnmap.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
ulpevent.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
ulpqueue.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00