Skip to content

Commit

Permalink
Issue 50829 - Disk monitoring rotated log cleanup causes heap-use-aft…
Browse files Browse the repository at this point in the history
…er-free

Description:  When Disk Monitoring finds that disk space is too low it starts
              freeing up disk space by removing rotated logs.  However the log
              list struct was not properly reset after freeing all the files
              in the list.  This is what allowed the heap-use-after-free to
              occur.

relates: https://pagure.io/389-ds-base/issue/50829

Reviewed by: firstyear(Thanks!)
  • Loading branch information
mreynolds389 committed Jan 20, 2020
1 parent 1d748c5 commit 16f7b52
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ldap/servers/slapd/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -3243,6 +3243,12 @@ log__delete_rotated_logs()
logp = logp->l_next;
slapi_ch_free((void **)&prev_log);
}

/* reset the log struct */
loginfo.log_access_logchain = NULL;
loginfo.log_audit_logchain = NULL;
loginfo.log_auditfail_logchain = NULL;
loginfo.log_error_logchain = NULL;
}

#define ERRORSLOG 1
Expand Down

0 comments on commit 16f7b52

Please sign in to comment.