aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/sctp
diff options
context:
space:
mode:
authorVlad Yasevich <vladislav.yasevich@hp.com>2008-03-20 18:17:14 -0400
committerDavid S. Miller <davem@davemloft.net>2008-03-20 18:17:14 -0400
commit270637abff0cdf848b910b9f96ad342e1da61c66 (patch)
treec5335ff19071e083588240da49b2aac27a402d8b /include/net/sctp
parentd0ebf133590abdc035af6e19a6568667af0ab3b0 (diff)
[SCTP]: Fix a race between module load and protosw access
There is a race is SCTP between the loading of the module and the access by the socket layer to the protocol functions. In particular, a list of addresss that SCTP maintains is not initialized prior to the registration with the protosw. Thus it is possible for a user application to gain access to SCTP functions before everything has been initialized. The problem shows up as odd crashes during connection initializtion when we try to access the SCTP address list. The solution is to refactor how we do registration and initialize the lists prior to registering with the protosw. Care must be taken since the address list initialization depends on some other pieces of SCTP initialization. Also the clean-up in case of failure now also needs to be refactored. Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com> Acked-by: Sridhar Samudrala <sri@us.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/sctp')
-rw-r--r--include/net/sctp/sctp.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index 57df27f19588..57ed3e323d97 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -380,15 +380,19 @@ static inline int sctp_sysctl_jiffies_ms(ctl_table *table, int __user *name, int
380 380
381#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 381#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
382 382
383int sctp_v6_init(void); 383void sctp_v6_pf_init(void);
384void sctp_v6_exit(void); 384void sctp_v6_pf_exit(void);
385int sctp_v6_protosw_init(void);
386void sctp_v6_protosw_exit(void);
385int sctp_v6_add_protocol(void); 387int sctp_v6_add_protocol(void);
386void sctp_v6_del_protocol(void); 388void sctp_v6_del_protocol(void);
387 389
388#else /* #ifdef defined(CONFIG_IPV6) */ 390#else /* #ifdef defined(CONFIG_IPV6) */
389 391
390static inline int sctp_v6_init(void) { return 0; } 392static inline void sctp_v6_pf_init(void) { return 0; }
391static inline void sctp_v6_exit(void) { return; } 393static inline void sctp_v6_pf_exit(void) { return; }
394static inline int sctp_v6_protosw_init(void) { return 0; }
395static inline void sctp_v6_protosw_exit(void) { return; }
392static inline int sctp_v6_add_protocol(void) { return 0; } 396static inline int sctp_v6_add_protocol(void) { return 0; }
393static inline void sctp_v6_del_protocol(void) { return; } 397static inline void sctp_v6_del_protocol(void) { return; }
394 398