linux/net/sctp
Marcelo Ricardo Leitner 3b97e138dd sctp: fix missing wake ups in some situations
[ Upstream commit 7906b00f5c ]

Commit fb586f2530 ("sctp: delay calls to sk_data_ready() as much as
possible") minimized the number of wake ups that are triggered in case
the association receives a packet with multiple data chunks on it and/or
when io_events are enabled and then commit 0970f5b366 ("sctp: signal
sk_data_ready earlier on data chunks reception") moved the wake up to as
soon as possible. It thus relies on the state machine running later to
clean the flag that the event was already generated.

The issue is that there are 2 call paths that calls
sctp_ulpq_tail_event() outside of the state machine, causing the flag to
linger and possibly omitting a needed wake up in the sequence.

One of the call paths is when enabling SCTP_SENDER_DRY_EVENTS via
setsockopt(SCTP_EVENTS), as noticed by Harald Welte. The other is when
partial reliability triggers removal of chunks from the send queue when
the application calls sendmsg().

This commit fixes it by not setting the flag in case the socket is not
owned by the user, as it won't be cleaned later. This works for
user-initiated calls and also for rx path processing.

Fixes: fb586f2530 ("sctp: delay calls to sk_data_ready() as much as possible")
Reported-by: Harald Welte <laforge@gnumonks.org>
Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2017-09-20 08:27:47 +02:00
..
associola.c net, sctp: convert sctp_ep_common.refcnt from atomic_t to refcount_t 2017-07-04 22:35:19 +01:00
auth.c net, sctp: convert sctp_auth_bytes.refcnt from atomic_t to refcount_t 2017-07-04 22:35:18 +01:00
bind_addr.c sctp: not copying duplicate addrs to the assoc's bind address list 2016-12-20 14:15:45 -05:00
chunk.c net, sctp: convert sctp_datamsg.refcnt from atomic_t to refcount_t 2017-07-04 22:35:18 +01:00
debug.c net: sctp: fix array overrun read on sctp_timer_tbl 2017-01-24 15:24:35 -05:00
endpointola.c net, sctp: convert sctp_ep_common.refcnt from atomic_t to refcount_t 2017-07-04 22:35:19 +01:00
input.c sctp: remove the typedef sctp_init_chunk_t 2017-07-01 09:08:42 -07:00
inqueue.c sctp: remove the typedef sctp_chunkhdr_t 2017-07-01 09:08:41 -07:00
ipv6.c sctp: fully initialize the IPv6 address in sctp_v6_to_addr() 2017-08-18 16:00:47 -07:00
Kconfig sctp: add the sctp_diag.c file 2016-04-15 17:29:36 -04:00
Makefile sctp: prepare asoc stream for stream reconf 2017-01-06 21:07:26 -05:00
objcnt.c sctp: prepare asoc stream for stream reconf 2017-01-06 21:07:26 -05:00
offload.c net: use skb->csum_not_inet to identify packets needing crc32c 2017-05-19 19:21:29 -04:00
output.c sctp: remove the typedef sctp_data_chunk_t 2017-07-01 09:08:42 -07:00
outqueue.c net: convert sk_buff.users from atomic_t to refcount_t 2017-07-01 07:39:07 -07:00
primitive.c sctp: add stream reconf primitive 2017-01-18 14:55:10 -05:00
probe.c net: sctp: Convert log timestamps to be y2038 safe 2016-03-01 17:18:44 -05:00
proc.c net: convert sock.sk_wmem_alloc from atomic_t to refcount_t 2017-07-01 07:39:08 -07:00
protocol.c net: Work around lockdep limitation in sockets that use sockets 2017-03-09 18:23:27 -08:00
sctp_diag.c sctp: Avoid out-of-bounds reads from address storage 2017-08-23 22:35:15 -07:00
sm_make_chunk.c sctp: fix an array overflow when all ext chunks are set 2017-07-14 09:05:10 -07:00
sm_sideeffect.c sctp: remove the typedef sctp_init_chunk_t 2017-07-01 09:08:42 -07:00
sm_statefuns.c sctp: remove the typedef sctp_init_chunk_t 2017-07-01 09:08:42 -07:00
sm_statetable.c sctp: remove the typedef sctp_cid_t 2017-07-01 09:08:41 -07:00
socket.c sctp: Avoid out-of-bounds reads from address storage 2017-08-23 22:35:15 -07:00
stream.c sctp: remove the typedef sctp_paramhdr_t 2017-07-01 09:08:41 -07:00
sysctl.c sctp: add get and set sockopt for reconf_enable 2017-03-12 23:22:24 -07:00
transport.c net, sctp: convert sctp_transport.refcnt from atomic_t to refcount_t 2017-07-04 22:35:19 +01:00
tsnmap.c sctp: Fix FSF address in file headers 2013-12-06 12:37:56 -05:00
ulpevent.c sctp: remove the typedef sctp_chunkhdr_t 2017-07-01 09:08:41 -07:00
ulpqueue.c sctp: fix missing wake ups in some situations 2017-09-20 08:27:47 +02:00