summaryrefslogtreecommitdiffstats
path: root/net/Makefile
diff options
context:
space:
mode:
authorXin Long <lucien.xin@gmail.com>2017-06-15 17:49:08 +0800
committerDavid S. Miller <davem@davemloft.net>2017-06-15 14:40:30 -0400
commit988c7322116970696211e902b468aefec95b6ec4 (patch)
tree7117f8e2e1bb92b1591217f7e79a4ef5a54cd725 /net/Makefile
parent5f2f97656ada8d811d3c1bef503ced266fcd53a0 (diff)
downloadlinux-988c7322116970696211e902b468aefec95b6ec4.tar.bz2
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: 626d16f50f39 ("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>
Diffstat (limited to 'net/Makefile')
0 files changed, 0 insertions, 0 deletions