diff options
author | Richard Yao <[email protected]> | 2022-09-15 14:46:42 -0400 |
---|---|---|
committer | Tony Hutter <[email protected]> | 2022-12-01 12:39:40 -0800 |
commit | 1d5e569a69e3887e07560d9e6fc6e26446ccc6ca (patch) | |
tree | 7b6d4b7d368b520e6bcd403568f5b04d711c450b /module | |
parent | 3f380df778c67bf6919df088ed9635323a6b6ffb (diff) |
Fix use-after-free bugs in icp code
These were reported by Coverity as "Read from pointer after free" bugs.
Presumably, it did not report it as a use-after-free bug because it does
not understand the inline assembly that implements the atomic
instruction.
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Richard Yao <[email protected]>
Closes #13881
Diffstat (limited to 'module')
-rw-r--r-- | module/icp/core/kcf_mech_tabs.c | 2 | ||||
-rw-r--r-- | module/icp/core/kcf_prov_tabs.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/module/icp/core/kcf_mech_tabs.c b/module/icp/core/kcf_mech_tabs.c index 2642b317d..00a76217f 100644 --- a/module/icp/core/kcf_mech_tabs.c +++ b/module/icp/core/kcf_mech_tabs.c @@ -720,8 +720,8 @@ kcf_remove_mech_provider(char *mech_name, kcf_provider_desc_t *prov_desc) } /* free entry */ - KCF_PROV_REFRELE(prov_mech->pm_prov_desc); KCF_PROV_IREFRELE(prov_mech->pm_prov_desc); + KCF_PROV_REFRELE(prov_mech->pm_prov_desc); kmem_free(prov_mech, sizeof (kcf_prov_mech_desc_t)); } diff --git a/module/icp/core/kcf_prov_tabs.c b/module/icp/core/kcf_prov_tabs.c index 9d303d022..3b0bf12e7 100644 --- a/module/icp/core/kcf_prov_tabs.c +++ b/module/icp/core/kcf_prov_tabs.c @@ -171,8 +171,8 @@ kcf_prov_tab_rem_provider(crypto_provider_id_t prov_id) * at that time. */ - KCF_PROV_REFRELE(prov_desc); KCF_PROV_IREFRELE(prov_desc); + KCF_PROV_REFRELE(prov_desc); return (CRYPTO_SUCCESS); } |