diff options
| author | Thomas Graf <tgraf@suug.ch> | 2012-12-06 04:25:05 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2012-12-07 14:15:04 -0500 |
| commit | 45122ca26ced7fae41049326a3797a73f961db2e (patch) | |
| tree | 347843ccf9b6a9eb9a4507e07b4c19faf0e59f70 /include/net/sctp | |
| parent | 0b0fe913bf6d551642eb8892ed90be7358906379 (diff) | |
sctp: Add RCU protection to assoc->transport_addr_list
peer.transport_addr_list is currently only protected by sk_sock
which is inpractical to acquire for procfs dumping purposes.
This patch adds RCU protection allowing for the procfs readers to
enter RCU read-side critical sections.
Modification of the list continues to be serialized via sk_lock.
V2: Use list_del_rcu() in sctp_association_free() to be safe
Skip transports marked dead when dumping for procfs
Cc: Vlad Yasevich <vyasevich@gmail.com>
Cc: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Acked-by: Vlad Yasevich <vyasevich@gmail.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/sctp')
| -rw-r--r-- | include/net/sctp/structs.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index c2521016d64..fdeb85a970f 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
| @@ -949,6 +949,8 @@ struct sctp_transport { | |||
| 949 | 949 | ||
| 950 | /* 64-bit random number sent with heartbeat. */ | 950 | /* 64-bit random number sent with heartbeat. */ |
| 951 | __u64 hb_nonce; | 951 | __u64 hb_nonce; |
| 952 | |||
| 953 | struct rcu_head rcu; | ||
| 952 | }; | 954 | }; |
| 953 | 955 | ||
| 954 | struct sctp_transport *sctp_transport_new(struct net *, const union sctp_addr *, | 956 | struct sctp_transport *sctp_transport_new(struct net *, const union sctp_addr *, |
