aboutsummaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorcandychencan <[email protected]>2016-10-01 07:04:43 +0800
committerBrian Behlendorf <[email protected]>2016-09-30 16:04:43 -0700
commit0ca5261be44abd9f6587792df1dc0c8ff73d2f7c (patch)
tree94644b9499c6528fe33f67ecb094e90aa86b0a88 /module
parent0a8f18f9327a6275759393c5fc2f14664f172add (diff)
Fix NULL deref in kcf_remove_mech_provider
In the default case the function must return to avoid dereferencing 'prov_mech' which will be NULL. Reviewed-by: Tom Caputi <[email protected]> Reviewed-by: Richard Laager <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: candychencan <[email protected]> Closes #5134
Diffstat (limited to 'module')
-rw-r--r--module/icp/core/kcf_mech_tabs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/module/icp/core/kcf_mech_tabs.c b/module/icp/core/kcf_mech_tabs.c
index 3545f03ee..3ed154758 100644
--- a/module/icp/core/kcf_mech_tabs.c
+++ b/module/icp/core/kcf_mech_tabs.c
@@ -659,7 +659,9 @@ kcf_remove_mech_provider(char *mech_name, kcf_provider_desc_t *prov_desc)
mech_entry->me_sw_prov = NULL;
break;
default:
- break;
+ /* unexpected crypto_provider_type_t */
+ mutex_exit(&mech_entry->me_mutex);
+ return;
}
mutex_exit(&mech_entry->me_mutex);