#933 Memory leak in HBAC access provider
Closed: Fixed None Opened 12 years ago by sgallagh.

From Coverity scan:

CID 10893: Resource leak (RESOURCE_LEAK)Calling allocation function "hbac_evaluate" on "info". [show details]
 578    result = hbac_evaluate(hbac_rules, eval_req, &info);
At conditional (1): "result == 0" taking the false branch.
 579    if (result == HBAC_EVAL_ALLOW) {
 580        DEBUG(3, ("Access granted by HBAC rule [%s]\n",
 581                  info->rule_name));
 582        hbac_free_info(info);
 583        ipa_access_reply(hbac_ctx, PAM_SUCCESS);
 584        return;
At conditional (2): "result == HBAC_EVAL_ERROR" taking the false branch.
 585    } else if (result == HBAC_EVAL_ERROR) {
 586        DEBUG(1, ("Error [%s] occurred in rule [%s]\n",
 587                  hbac_error_string(info->code),
 588                  info->rule_name));
 589        hbac_free_info(info);
 590        ipa_access_reply(hbac_ctx, PAM_SYSTEM_ERR);
 591        return;
At conditional (3): "result == 2" taking the false branch.
 592    } else if (result == HBAC_EVAL_OOM) {
 593        DEBUG(1, ("Insufficient memory\n"));
 594        ipa_access_reply(hbac_ctx, PAM_SYSTEM_ERR);
 595        return;
 596    }
 597
At conditional (4): "3 <= debug_level" taking the true branch.
At conditional (5): "debug_timestamps" taking the true branch.
 598    DEBUG(3, ("Access denied by HBAC rules\n"));
 599    ipa_access_reply(hbac_ctx, PAM_PERM_DENIED);
Variable "info" going out of scope leaks the storage it points to.
 600}

Fixed by a0be5e4

resolution: => fixed
status: new => closed

Backported to sssd-1-5

5f56c77

milestone: SSSD 1.6.0 => SSSD 1.5.12

Fields changed

rhbz: => 0

Metadata Update from @sgallagh:
- Issue assigned to sgallagh
- Issue set to the milestone: SSSD 1.5.12

7 years ago

SSSD is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in SSSD's github repository.

This issue has been cloned to Github and is available here:
- https://github.com/SSSD/sssd/issues/1975

If you want to receive further updates on the issue, please navigate to the github issue
and click on subscribe button.

Thank you for understanding. We apologize for all inconvenience.

Login to comment on this ticket.

Metadata