Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1766490

Summary: Use negative cache better and domain checks for lookup by SIDs
Product: Red Hat Enterprise Linux 9 Reporter: Sumit Bose <sbose>
Component: sssdAssignee: Tomas Halman <thalman>
Status: CLOSED ERRATA QA Contact: shridhar <sgadekar>
Severity: medium Docs Contact:
Priority: medium    
Version: 9.1CC: anikandr, atikhono, grajaiya, jhrozek, lslebodn, mzidek, pasik, pbrezina, sebastien.toulmonde, sgadekar, thalman, tscherf
Target Milestone: rcKeywords: Improvement, Triaged
Target Release: ---Flags: anikandr: needinfo+
pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: sync-to-jira
Fixed In Version: sssd-2.8.1-1.el9 Doc Type: Enhancement
Doc Text:
.Enhance negative cache usage This update improves the SSSD performance for lookups by Security Identifier (SID). It now stores non-existing SIDs in the negative cache for individual domains and requests the domain that the SID belongs to.
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-09 08:19:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Sumit Bose 2019-10-29 09:22:39 UTC
Description of problem:

Although the negative cache is checked while processing requests by SIDs it is still not used properly because only a global add function is set in src/responder/common/cache_req/plugins/cache_req_object_by_sid.c but not the add function for individual domains. So if a SID does not exists at all it is added to the negative cache but during a multi-domain search a SID which does not exists in an individual domain is not added to the negative cache of the individual domain.

...
    .global_ncache_add_fn = cache_req_object_by_sid_global_ncache_add,
    .ncache_check_fn = cache_req_object_by_sid_ncache_check,
    .ncache_add_fn = NULL,
    .ncache_filter_fn = NULL,
    .lookup_fn = cache_req_object_by_sid_lookup,
    .dp_send_fn = cache_req_object_by_sid_dp_send,
    .dp_recv_fn = cache_req_common_dp_recv,
    .dp_get_domain_check_fn = NULL,
    .dp_get_domain_send_fn = NULL,
    .dp_get_domain_recv_fn = NULL,
};
...

Additionally, since we already have the *get_domain* check mechanism to go straight to the right domain this should be used for requests by SID as well so that a multi-domain search would only be used as the fallback case.

Comment 4 Alexey Tikhonov 2022-09-21 15:13:03 UTC
Upstream PR: https://github.com/SSSD/sssd/pull/6353

Comment 5 Alexey Tikhonov 2022-10-05 14:26:03 UTC
Pushed PR: https://github.com/SSSD/sssd/pull/6353

* `master`
    * 5ea1ed27f55508958b21e46a01464f6a3aed11ad - CACHE: implement *get_domain* for SID lookup
    * 70d5460b0d021e14a84371d367edb67262559713 - CACHE: implement ncache_add_fn for ncache SID

Comment 15 errata-xmlrpc 2023-05-09 08:19:50 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (sssd bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:2514