Bug 1390536

Summary: semodule_package tries to mmap() an empty file
Product: Red Hat Enterprise Linux 6 Reporter: Milos Malik <mmalik>
Component: policycoreutilsAssignee: Petr Lautrbach <plautrba>
Status: CLOSED WONTFIX QA Contact: Milos Malik <mmalik>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.8CC: dwalsh, 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: 1390535 Environment:
Last Closed: 2016-11-01 10:34:03 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:

Description Milos Malik 2016-11-01 10:31:24 UTC
+++ This bug was initially created as a clone of Bug #1390535 +++

Description of problem:
* already fixed in upstream, but it still affects RHEL-6.8

Version-Release number of selected component (if applicable):
policycoreutils-gui-2.0.83-29.el6.x86_64
policycoreutils-python-2.0.83-29.el6.x86_64
policycoreutils-2.0.83-29.el6.x86_64
policycoreutils-sandbox-2.0.83-29.el6.x86_64
policycoreutils-newrole-2.0.83-29.el6.x86_64

How reproducible:
* always

Steps to Reproduce:
# checkmodule -M -m -o mypolicy.mod mypolicy.te
checkmodule:  loading policy configuration from mypolicy.te
checkmodule:  policy configuration loaded
checkmodule:  writing binary representation (version 10) to mypolicy.mod
# rm -f mypolicy.fc mypolicy.nc
# touch mypolicy.fc mypolicy.nc
# semodule_package -o mypolicy.pp -m mypolicy.mod --fc mypolicy.fc
semodule_package:  Failed to mmap mypolicy.fc:  Invalid argument
# semodule_package -o mypolicy.pp -m mypolicy.mod --nc mypolicy.nc
semodule_package:  Failed to mmap mypolicy.nc:  Invalid argument
# 

Actual results:
* semodule_package calls mmap() on an empty file

Expected results:
* semodule_package doesn't call mmap() on an empty file

Comment 1 Petr Lautrbach 2016-11-01 10:34:03 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 will be fixed in Red Hat Enterprise Linux version 7