linux-stable/net/tipc
Tuong Lien dca4a17d24 tipc: fix potential hanging after b/rcast changing
In commit c55c8edafa ("tipc: smooth change between replicast and
broadcast"), we allow instant switching between replicast and broadcast
by sending a dummy 'SYN' packet on the last used link to synchronize
packets on the links. The 'SYN' message is an object of link congestion
also, so if that happens, a 'SOCK_WAKEUP' will be scheduled to be sent
back to the socket...
However, in that commit, we simply use the same socket 'cong_link_cnt'
counter for both the 'SYN' & normal payload message sending. Therefore,
if both the replicast & broadcast links are congested, the counter will
be not updated correctly but overwritten by the latter congestion.
Later on, when the 'SOCK_WAKEUP' messages are processed, the counter is
reduced one by one and eventually overflowed. Consequently, further
activities on the socket will only wait for the false congestion signal
to disappear but never been met.

Because sending the 'SYN' message is vital for the mechanism, it should
be done anyway. This commit fixes the issue by marking the message with
an error code e.g. 'TIPC_ERR_NO_PORT', so its sending should not face a
link congestion, there is no need to touch the socket 'cong_link_cnt'
either. In addition, in the event of any error (e.g. -ENOBUFS), we will
purge the entire payload message queue and make a return immediately.

Fixes: c55c8edafa ("tipc: smooth change between replicast and broadcast")
Acked-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: Tuong Lien <tuong.t.lien@dektech.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-12-10 17:45:04 -08:00
..
addr.c tipc: initialise addr_trail_end when setting node addresses 2019-08-11 21:40:04 -07:00
addr.h
bcast.c tipc: fix potential hanging after b/rcast changing 2019-12-10 17:45:04 -08:00
bcast.h tipc: update replicast capability for broadcast send link 2019-11-22 09:29:50 -08:00
bearer.c tipc: introduce TIPC encryption & authentication 2019-11-08 14:01:59 -08:00
bearer.h tipc: introduce TIPC encryption & authentication 2019-11-08 14:01:59 -08:00
core.c tipc: fix ordering of tipc module init and exit routine 2019-12-06 12:01:09 -08:00
core.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-11-16 21:51:42 -08:00
crypto.c tipc: fix update of the uninitialized variable err 2019-11-11 22:04:03 -08:00
crypto.h tipc: introduce TIPC encryption & authentication 2019-11-08 14:01:59 -08:00
diag.c tipc: switch to rhashtable iterator 2018-08-29 18:04:54 -07:00
discover.c tipc: improve throughput between nodes in netns 2019-10-29 17:55:38 -07:00
discover.h
eth_media.c
group.c tipc: clean up skb list lock handling on send path 2019-08-18 14:01:07 -07:00
group.h tipc: extend sock diag for group communication 2018-06-30 21:05:42 +09:00
ib_media.c
Kconfig tipc: introduce TIPC encryption & authentication 2019-11-08 14:01:59 -08:00
link.c tipc: update replicast capability for broadcast send link 2019-11-22 09:29:50 -08:00
link.h tipc: introduce TIPC encryption & authentication 2019-11-08 14:01:59 -08:00
Makefile tipc: introduce TIPC encryption & authentication 2019-11-08 14:01:59 -08:00
monitor.c tipc: update mon's self addr when node addr generated 2019-11-12 19:45:45 -08:00
monitor.h tipc: update mon's self addr when node addr generated 2019-11-12 19:45:45 -08:00
msg.c tipc: introduce TIPC encryption & authentication 2019-11-08 14:01:59 -08:00
msg.h tipc: introduce TIPC encryption & authentication 2019-11-08 14:01:59 -08:00
name_distr.c tipc: improve throughput between nodes in netns 2019-10-29 17:55:38 -07:00
name_distr.h
name_table.c tipc: fix name table rbtree issues 2019-12-10 17:45:04 -08:00
name_table.h tipc: support in-order name publication events 2019-11-22 09:29:50 -08:00
net.c tipc: update mon's self addr when node addr generated 2019-11-12 19:45:45 -08:00
net.h tipc: fix lockdep warning when reinitilaizing sockets 2018-11-17 22:01:31 -08:00
netlink.c tipc: add support for AEAD key setting via netlink 2019-11-08 14:01:59 -08:00
netlink.h net: tipc: allocate attrs locally instead of using genl_family_attrbuf in compat_dumpit() 2019-10-06 15:44:47 +02:00
netlink_compat.c tipc: fix link name length check 2019-11-26 10:03:12 -08:00
node.c tipc: update replicast capability for broadcast send link 2019-11-22 09:29:50 -08:00
node.h tipc: add support for AEAD key setting via netlink 2019-11-08 14:01:59 -08:00
socket.c tipc: fix duplicate SYN messages under link congestion 2019-11-28 23:09:15 -08:00
socket.h tipc: add trace_events for tipc socket 2018-12-19 11:49:24 -08:00
subscr.c
subscr.h tipc: fix modprobe tipc failed after switch order of device registration 2019-05-20 10:45:43 -07:00
sysctl.c tipc: introduce TIPC encryption & authentication 2019-11-08 14:01:59 -08:00
topsrv.c tipc: add loopback device tracking 2019-08-08 22:11:39 -07:00
topsrv.h
trace.c tipc: remove unneeded semicolon in trace.c 2019-01-17 22:04:43 -08:00
trace.h tipc: add trace_events for tipc bearer 2018-12-19 11:49:25 -08:00
udp_media.c net: ipv6_stub: use ip6_dst_lookup_flow instead of ip6_dst_lookup 2019-12-04 12:27:13 -08:00
udp_media.h