summaryrefslogtreecommitdiff
path: root/net/sctp/socket.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2016-10-31 16:20:33 -0400
committerDavid S. Miller <davem@davemloft.net>2016-10-31 16:20:33 -0400
commit1137086fc85712aa123d29c87c604310a17a7d4e (patch)
tree5ea1f8d710959c462452efaa4fffc8d7d1f0cbb7 /net/sctp/socket.c
parent87557efc27f6a50140fb20df06a917f368ce3c66 (diff)
parentdae399d7fdee84d8f5227a9711d95bb4e9a05d4e (diff)
Merge branch 'sctp-hold-transport-fixes'
Xin Long says: ==================== sctp: a bunch of fixes by holding transport There are several places where it holds assoc after getting transport by searching from transport rhashtable, it may cause use-after-free issue. This patchset is to fix them by holding transport instead. v1->v2: Fix the changelog of patch 2/3 ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/socket.c')
-rw-r--r--net/sctp/socket.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 9fbb6feb8c27..71b75f9d9c1b 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -4480,12 +4480,9 @@ int sctp_transport_lookup_process(int (*cb)(struct sctp_transport *, void *),
if (!transport || !sctp_transport_hold(transport))
goto out;
- sctp_association_hold(transport->asoc);
- sctp_transport_put(transport);
-
rcu_read_unlock();
err = cb(transport, p);
- sctp_association_put(transport->asoc);
+ sctp_transport_put(transport);
out:
return err;