mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-04 10:19:26 +00:00
Set ses_ictx and ses_octx to NULL after freeing them, so we won't free
them twice. This is possible for example in situation when session is used in authentication context, then freed and then used in encryption context and freed - in encryption context ses_ictx and ses_octx are not touched at newsession time, but padlock_freesession could still try to free them when they are not NULL.
This commit is contained in:
parent
87b4dfd5b2
commit
5362e27b6d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=160568
@ -489,10 +489,12 @@ padlock_freesession(void *arg __unused, uint64_t tid)
|
||||
if (ses->ses_ictx != NULL) {
|
||||
bzero(ses->ses_ictx, sizeof(ses->ses_ictx));
|
||||
free(ses->ses_ictx, M_CRYPTO_DATA);
|
||||
ses->ses_ictx = NULL;
|
||||
}
|
||||
if (ses->ses_octx != NULL) {
|
||||
bzero(ses->ses_octx, sizeof(ses->ses_octx));
|
||||
free(ses->ses_octx, M_CRYPTO_DATA);
|
||||
ses->ses_octx = NULL;
|
||||
}
|
||||
bzero(ses, sizeof(ses));
|
||||
ses->ses_used = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user