Bug 1373083

Summary: "mmap: Invalid argument" while executing `restorecon /var/crash/` with libselinux-2.5-6.el7.x86_64
Product: Red Hat Enterprise Linux 7 Reporter: Qiao Zhao <qzhao>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED DUPLICATE QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.3CC: kdump-team-bugs, lvrabec, mgrepl, mmalik, panand, plautrba, pvrabec, ruyang, 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-09-08 06:00:24 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 Qiao Zhao 2016-09-05 06:30:44 UTC
Description of problem:
I just notice this problem from kernel-3.10.0-500.el7, like:
# kdumpctl restart
kexec: unloaded kdump kernel
Stopping kdump: [OK]
mmap: Invalid argument
Detected change(s) in the following file(s):
  
  /etc/kdump.conf
Rebuilding /boot/initramfs-3.10.0-500.el7.x86_64kdump.img
mmap: Invalid argument
mmap: Invalid argument
mmap: Invalid argument
mmap: Invalid argument
mmap: Invalid argument
mmap: Invalid argument
mmap: Invalid argument
mmap: Invalid argument
mmap: Invalid argument
mmap: Invalid argument
mmap: Invalid argument
kexec: loaded kdump kernel
Starting kdump: [OK]

Can't find this message on kernel-3.10.0-495.el7, i will do some kernel bisect to make sure which fix caused this problem.

Version-Release number of selected component (if applicable):
kexec-tools-2.0.7-49.el7

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 3 Pratyush Anand 2016-09-06 15:18:30 UTC
It is the restorecon command which is generating this error message. 
# restorecon /var/crash/
  mmap: Invalid argument

# rpm -qf `which restorecon`
policycoreutils-2.5-8.el7.x86_64

However, version of policycoreutils seems same in RHEL-7.3-20160901.1 and RHEL-7.3-20160825.1.

Comment 4 Pratyush Anand 2016-09-08 04:54:35 UTC
I did some more experiments with policycoreutils code from https://github.com/SELinuxProject/selinux.git. This error is printed when selabel_open() is called, which is part of libselinux. RHEL-7.3-20160901.1 has libselinux-2.5-6 and, RHEL-7.3-20160825.1 had libselinux-2.5-5. So, I think error was introduced in libselinux-2.5-6.

Therefore, it would be good to assign this BZ to selinux team.

Simplified reproducer:
(1) Use libselinux-2.5-6.el7.x86_64
(2) execute `restorecon /var/crash/`

You will see a message "mmap: Invalid argument".

Comment 5 Petr Lautrbach 2016-09-08 06:00:24 UTC

*** This bug has been marked as a duplicate of bug 1372200 ***