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 1433969 - coredump happens when starting kdump service with "path /" specified in /etc/kdump.conf
Summary: coredump happens when starting kdump service with "path /" specified in /etc/...
Keywords:
Status: CLOSED DUPLICATE of bug 1404644
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: policycoreutils
Version: 7.4
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Petr Lautrbach
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-03-20 13:34 UTC by Xunlei Pang
Modified: 2017-03-29 13:54 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-03-29 13:54:48 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Xunlei Pang 2017-03-20 13:34:03 UTC
Description of problem:
When specifying "path /" in /etc/kdump.conf, and restart kdump service,
we will get the following message:

kexec: unloaded kdump kernel
Stopping kdump: [OK]
pxl selinux_relabel: ///
*** Error in `restorecon': free(): invalid pointer: 0x00007f7f6869f1e1 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x7cfe1)[0x7f7f66afcfe1]
/lib64/libselinux.so.1(realpath_not_final+0xc0)[0x7f7f672b5750]
restorecon(+0x3a33)[0x7f7f676f9a33]
restorecon(+0x3bcb)[0x7f7f676f9bcb]
restorecon(+0x242c)[0x7f7f676f842c]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x7f7f66aa1b15]
restorecon(+0x267d)[0x7f7f676f867d]
======= Memory map: ========

... ...
7fbf7f375000-7fbf7f534000 rw-p 00000000 00:00 0                          [heap]
7ffd02d78000-7ffd02d99000 rw-p 00000000 00:00 0                          [stack]
7ffd02db0000-7ffd02db2000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
/usr/bin/kdumpctl: line 962:  8855 Aborted                 (core dumped) restorecon $_i

Version-Release number of selected component (if applicable):


How reproducible:
kexec-tools-2.0.7-51.el7.x86_64

Steps to Reproduce:
1. in /etc/kdump.conf
   change default "path /var/crash" to "path /"
2. kdumpctl restart

Actual results:


Expected results:
no coredump happens, kdump can start properly.

Additional info:

Comment 2 Xunlei Pang 2017-03-27 06:20:30 UTC
The root cause is that "restorecon" generated the coredump.

I was able to reproduce it in the following way:
1) create a symbol link file, say
mkdir /restorecon
touch /restorecon/test
ln /restorecon/test -s /restorecon/link
2) then "restorecon /restorecon/link" or "restorecon /restorecon//link" or even more "/" appended to the second "/", it works well
3) but "restorecon //restorecon/link"(append multiple "/" at the very beginning) will surely trigger coredump

So the bug is due to some problem of "restorecon", but we could make a simple workaround by stripping all the duplicate "/".

Also we better not do the relabel in case of "/", as there are so many files(including procfs, sysfs, etc) under "/" which is really time-consuming and needless.

Comment 3 Xunlei Pang 2017-03-28 09:40:39 UTC
Besides the special "path /", It also affects kdump using "path /var/crash" if there happens to be some link file and needs to be relabelled, because our script generates two more "/" at the very beginning.

After discussion, we decide to reassign it to "restorecon" related component.

Comment 4 Milos Malik 2017-03-28 09:46:08 UTC
Which version of libselinux was installed on your machine, when the coredump appeared?

Comment 5 Milos Malik 2017-03-28 10:00:04 UTC
It's possible that you encountered BZ#1404644.

Comment 6 Xunlei Pang 2017-03-28 14:00:16 UTC
(In reply to Milos Malik from comment #4)
> Which version of libselinux was installed on your machine, when the coredump
> appeared?

I confirmed it has been fixed on latest rhel7.4(with the following RPMs):
policycoreutils-2.5-14.el7.x86_64
libselinux-2.5-11.el7.x86_64
libselinux-python-2.5-11.el7.x86_64
libselinux-utils-2.5-11.el7.x86_64

I think you can close it as CURRENTRELEASE, thanks!

Comment 7 Petr Lautrbach 2017-03-29 13:54:48 UTC

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


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