Bug 1390909 - selabel_lookup() segfaults when path is NULL
Summary: selabel_lookup() segfaults when path is NULL
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libselinux
Version: 6.9
Hardware: All
OS: Linux
unspecified
low
Target Milestone: rc
: ---
Assignee: Petr Lautrbach
QA Contact: Jan Zarsky
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-02 08:54 UTC by Jan Zarsky
Modified: 2016-11-03 07:54 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-02 16:59:48 UTC
Target Upstream Version:


Attachments (Terms of Use)

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


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