Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6

Pull crypto fix from Herbert Xu:
"This fixes a crash in the crypto layer exposed by an SCTP test tool"

* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
crypto: algboss - Hold ref count on larval

+14 -13
+8 -7
crypto/algboss.c
··· 45 45 } nu32; 46 46 } attrs[CRYPTO_MAX_ATTRS]; 47 47 48 - char larval[CRYPTO_MAX_ALG_NAME]; 49 48 char template[CRYPTO_MAX_ALG_NAME]; 50 49 51 - struct completion *completion; 50 + struct crypto_larval *larval; 52 51 53 52 u32 otype; 54 53 u32 omask; ··· 86 87 crypto_tmpl_put(tmpl); 87 88 88 89 out: 89 - complete_all(param->completion); 90 + complete_all(&param->larval->completion); 91 + crypto_alg_put(&param->larval->alg); 90 92 kfree(param); 91 93 module_put_and_exit(0); 92 94 } ··· 187 187 param->otype = larval->alg.cra_flags; 188 188 param->omask = larval->mask; 189 189 190 - memcpy(param->larval, larval->alg.cra_name, CRYPTO_MAX_ALG_NAME); 191 - 192 - param->completion = &larval->completion; 190 + crypto_alg_get(&larval->alg); 191 + param->larval = larval; 193 192 194 193 thread = kthread_run(cryptomgr_probe, param, "cryptomgr_probe"); 195 194 if (IS_ERR(thread)) 196 - goto err_free_param; 195 + goto err_put_larval; 197 196 198 197 wait_for_completion_interruptible(&larval->completion); 199 198 200 199 return NOTIFY_STOP; 201 200 201 + err_put_larval: 202 + crypto_alg_put(&larval->alg); 202 203 err_free_param: 203 204 kfree(param); 204 205 err_put_module:
-6
crypto/api.c
··· 34 34 BLOCKING_NOTIFIER_HEAD(crypto_chain); 35 35 EXPORT_SYMBOL_GPL(crypto_chain); 36 36 37 - static inline struct crypto_alg *crypto_alg_get(struct crypto_alg *alg) 38 - { 39 - atomic_inc(&alg->cra_refcnt); 40 - return alg; 41 - } 42 - 43 37 struct crypto_alg *crypto_mod_get(struct crypto_alg *alg) 44 38 { 45 39 return try_module_get(alg->cra_module) ? crypto_alg_get(alg) : NULL;
+6
crypto/internal.h
··· 103 103 int crypto_unregister_notifier(struct notifier_block *nb); 104 104 int crypto_probing_notify(unsigned long val, void *v); 105 105 106 + static inline struct crypto_alg *crypto_alg_get(struct crypto_alg *alg) 107 + { 108 + atomic_inc(&alg->cra_refcnt); 109 + return alg; 110 + } 111 + 106 112 static inline void crypto_alg_put(struct crypto_alg *alg) 107 113 { 108 114 if (atomic_dec_and_test(&alg->cra_refcnt) && alg->cra_destroy)