Subject: crypto: Make core builtin and init srcu early From: Thomas Gleixner Date: Fri, 12 Oct 2012 11:09:19 +0100 When the scru notifier is not initialized before the first user we crash. [ 0.281119] BUG: unable to handle kernel NULL pointer dereference at (null) [ 0.281124] IP: [] __srcu_read_lock+0x2f/0x79 Make the core code built-in for now and enfore early init. FIXME: Create a static initializer for this. Signed-off-by: Thomas Gleixner --- crypto/Kconfig | 2 +- crypto/api.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) Index: linux-stable/crypto/Kconfig =================================================================== --- linux-stable.orig/crypto/Kconfig +++ linux-stable/crypto/Kconfig @@ -13,7 +13,7 @@ source "crypto/async_tx/Kconfig" # Cryptographic API Configuration # menuconfig CRYPTO - tristate "Cryptographic API" + bool "Cryptographic API" help This option provides the core Cryptographic API. Index: linux-stable/crypto/api.c =================================================================== --- linux-stable.orig/crypto/api.c +++ linux-stable/crypto/api.c @@ -34,6 +34,13 @@ EXPORT_SYMBOL_GPL(crypto_alg_sem); struct srcu_notifier_head crypto_chain; EXPORT_SYMBOL_GPL(crypto_chain); +static int __init crypto_api_init(void) +{ + srcu_init_notifier_head(&crypto_chain); + return 0; +} +core_initcall(crypto_api_init); + static inline struct crypto_alg *crypto_alg_get(struct crypto_alg *alg) { atomic_inc(&alg->cra_refcnt);