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 889215 - [Coverity] Explicit null dereferenced
Summary: [Coverity] Explicit null dereferenced
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: sssd
Version: 7.0
Hardware: Unspecified
OS: Unspecified
low
unspecified
Target Milestone: rc
: ---
Assignee: Jakub Hrozek
QA Contact: Kaushik Banerjee
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-12-20 14:20 UTC by Dmitri Pal
Modified: 2020-05-02 17:11 UTC (History)
4 users (show)

Fixed In Version: sssd-1.10.0-1.el7.alpha1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-13 09:17:43 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github SSSD sssd issues 2766 0 None None None 2020-05-02 17:11:18 UTC

Description Dmitri Pal 2012-12-20 14:20:18 UTC
This bug is created as a clone of upstream ticket:
https://fedorahosted.org/sssd/ticket/1724

{{{
195errno_t sss_nss_mc_get_record(struct sss_cli_mc_ctx *ctx,
196                              uint32_t slot, struct sss_mc_rec **_rec)
197{
198    struct sss_mc_rec *rec;
CID 13122: Explicit null dereferenced (FORWARD_NULL)Assigning: "copy_rec" = 0.
199    struct sss_mc_rec *copy_rec = NULL;
200    size_t buf_size = 0;
201    size_t rec_len;
202    uint32_t b1;
203    uint32_t b2;
204    bool copy_ok;
205    int count;
206    int ret;
207
208    /* try max 5 times */
At conditional (1): "count > 0" taking the true branch.
At conditional (3): "count > 0" taking the true branch.
At conditional (5): "count > 0" taking the true branch.
209    for (count = 5; count > 0; count--) {
210        rec = MC_SLOT_TO_PTR(ctx->data_table, slot, struct sss_mc_rec);
211
212        /* fetch record length */
213        b1 = rec->b1;
214        __sync_synchronize();
215        rec_len = rec->len;
216        __sync_synchronize();
217        b2 = rec->b2;
At conditional (2): "!((b1 & 0xff000000U) == 0xf0000000U)" taking the true branch.
At conditional (4): "!((b1 & 0xff000000U) == 0xf0000000U)" taking the true branch.
At conditional (6): "!((b1 & 0xff000000U) == 0xf0000000U)" taking the false branch.
At conditional (7): "b1 != b2" taking the false branch.
218        if (!MC_VALID_BARRIER(b1) || b1 != b2) {
219            /* record is inconsistent, retry */
220            continue;
221        }
222
At conditional (8): "rec_len > buf_size" taking the false branch.
223        if (rec_len > buf_size) {
224            free(copy_rec);
225            copy_rec = malloc(rec_len);
226            if (!copy_rec) {
227                ret = ENOMEM;
228                goto done;
229            }
230            buf_size = rec_len;
231        }
232        /* we cannot access data directly, we must copy data and then
233         * access the copy */
At conditional (9): "(_b1 & 0xff000000U) == 0xf0000000U" taking the true branch.
Passing null variable "copy_rec" to function "memcpy", which dereferences it. (The dereference is assumed on the basis of the 'nonnull' parameter attribute.)
234        MEMCPY_WITH_BARRIERS(copy_ok, copy_rec, rec, rec_len);
235
236        /* we must check data is consistent again after the copy */
}}}

Comment 1 Jakub Hrozek 2013-03-26 18:07:53 UTC
Fixed upstream.

Comment 2 Jakub Hrozek 2013-10-04 13:23:31 UTC
Temporarily moving bugs to MODIFIED to work around errata tool bug

Comment 4 Amith 2014-01-29 08:02:51 UTC
Verified on sssd-1.11.2-1.el7.x86_64

This bug has been verified sanity only and no related regressions detected during the execution of inmemory_cache test suite. See the beaker link: https://beaker.engineering.redhat.com/jobs/563836

Comment 5 Ludek Smid 2014-06-13 09:17:43 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.


Note You need to log in before you can comment on or make changes to this bug.