android_kernel_motorola_sm6225/net/sctp
Xin Long 988c732211 sctp: return next obj by passing pos + 1 into sctp_transport_get_idx
In sctp_for_each_transport, pos is used to save how many objs it has
dumped. Now it gets the last obj by sctp_transport_get_idx, then gets
the next obj by sctp_transport_get_next.

The issue is that in the meanwhile if some objs in transport hashtable
are removed and the objs nums are less than pos, sctp_transport_get_idx
would return NULL and hti.walker.tbl is NULL as well. At this moment
it should stop hti, instead of continue getting the next obj. Or it
would cause a NULL pointer dereference in sctp_transport_get_next.

This patch is to pass pos + 1 into sctp_transport_get_idx to get the
next obj directly, even if pos > objs nums, it would return NULL and
stop hti.

Fixes: 626d16f50f ("sctp: export some apis or variables for sctp_diag and reuse some for proc")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-15 14:40:30 -04:00
..
associola.c sctp: fix stream update when processing dupcookie 2017-05-24 15:21:04 -04:00
auth.c sctp: use IS_ENABLED() instead of checking for built-in or module 2016-09-10 21:19:11 -07: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 sctp: add SCTP_PR_STREAM_STATUS sockopt for prsctp 2017-04-03 14:52:35 -07:00
debug.c net: sctp: fix array overrun read on sctp_timer_tbl 2017-01-24 15:24:35 -05:00
endpointola.c sctp: add reconf_enable in asoc ep and netns 2017-01-18 14:55:10 -05:00
input.c sctp: fix ICMP processing if skb is non-linear 2017-05-26 14:40:46 -04:00
inqueue.c sctp: rename WORD_TRUNC/ROUND macros 2016-09-22 03:13:26 -04:00
ipv6.c sctp: do not inherit ipv6_{mc|ac|fl}_list from parent 2017-05-18 10:24:08 -04: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 sctp: sctp gso should set feature with NETIF_F_SG when calling skb_segment 2017-01-25 12:28:33 -05:00
output.c sctp: get sock from transport in sctp_transport_update_pmtu 2017-04-05 07:20:06 -07:00
outqueue.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-04-06 08:24:51 -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 sctp: use right in and out stream cnt 2017-04-01 20:12:30 -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 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-10-02 22:20:41 -04:00
sm_make_chunk.c sctp: set new_asoc temp when processing dupcookie 2017-05-24 15:21:04 -04:00
sm_sideeffect.c sctp: flush out queue once assoc state falls into SHUTDOWN_PENDING 2017-02-20 10:26:09 -05:00
sm_statefuns.c sctp: set new_asoc temp when processing dupcookie 2017-05-24 15:21:04 -04:00
sm_statetable.c sctp: add reconf chunk event 2017-02-19 18:17:59 -05:00
socket.c sctp: return next obj by passing pos + 1 into sctp_transport_get_idx 2017-06-15 14:40:30 -04:00
stream.c sctp: process duplicated strreset asoc request correctly 2017-04-18 13:39:50 -04:00
sysctl.c sctp: add get and set sockopt for reconf_enable 2017-03-12 23:22:24 -07:00
transport.c sctp: get sock from transport in sctp_transport_update_pmtu 2017-04-05 07:20:06 -07:00
tsnmap.c sctp: Fix FSF address in file headers 2013-12-06 12:37:56 -05:00
ulpevent.c sctp: add support for generating add stream change event notification 2017-03-12 23:22:23 -07:00
ulpqueue.c sctp: prepare asoc stream for stream reconf 2017-01-06 21:07:26 -05:00