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 1390909

Summary: selabel_lookup() segfaults when path is NULL
Product: Red Hat Enterprise Linux 6 Reporter: Jan Zarsky <jzarsky>
Component: libselinuxAssignee: Petr Lautrbach <plautrba>
Status: CLOSED WONTFIX QA Contact: Jan Zarsky <jzarsky>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.9CC: lvrabec, mgrepl, mmalik, plautrba, ssekidde
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-02 16:59:48 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 Jan Zarsky 2016-11-02 08:54:53 UTC
Description of problem:
functions selabel_lookup and selabel_lookup_raw 

Version-Release number of selected component (if applicable):
libselinux-2.0.94-7.el6.x86_64

Steps to Reproduce:
1. Run this program:
#include <stdio.h>
#include <selinux/selinux.h>
#include <selinux/label.h>

int main (int argc, char **argv) {
    struct selabel_handle *hnd = selabel_open(SELABEL_CTX_FILE, NULL, 0);

    security_context_t selabel_context;

    // path == NULL
    selabel_lookup(hnd, &selabel_context, NULL, 0);

    freecon(selabel_context);
    selabel_close(hnd);
}

Actual results:
Segmentation fault

Expected results:
errno == EINVAL

Additional info:
This bug is fixed in 7.3, upstream fix is here: https://github.com/SELinuxProject/selinux/commit/16a37c9f94c1e2dfb865e17e4200d2824d4971f5

Comment 2 Petr Lautrbach 2016-11-02 16:59:48 UTC
Red Hat Enterprise Linux version 6 is entering the Production 2 phase of its lifetime and this bug doesn't meet the criteria for it, i.e. only high severity issues will be fixed. Please see https://access.redhat.com/support/policy/updates/errata/ for further information.

This issue is fixed in Red Hat Enterprise Linux version 7