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 <behlendorf1@llnl.gov> Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu> Closes #13881
This commit is contained in:
parent
3f380df778
commit
1d5e569a69
|
@ -720,8 +720,8 @@ kcf_remove_mech_provider(char *mech_name, kcf_provider_desc_t *prov_desc)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* free entry */
|
/* free entry */
|
||||||
KCF_PROV_REFRELE(prov_mech->pm_prov_desc);
|
|
||||||
KCF_PROV_IREFRELE(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));
|
kmem_free(prov_mech, sizeof (kcf_prov_mech_desc_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -171,8 +171,8 @@ kcf_prov_tab_rem_provider(crypto_provider_id_t prov_id)
|
||||||
* at that time.
|
* at that time.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
KCF_PROV_REFRELE(prov_desc);
|
|
||||||
KCF_PROV_IREFRELE(prov_desc);
|
KCF_PROV_IREFRELE(prov_desc);
|
||||||
|
KCF_PROV_REFRELE(prov_desc);
|
||||||
|
|
||||||
return (CRYPTO_SUCCESS);
|
return (CRYPTO_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue