Bug 1376598 - [abrt] policycoreutils: realpath_not_final(): setfiles killed by SIGABRT
Summary: [abrt] policycoreutils: realpath_not_final(): setfiles killed by SIGABRT
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: policycoreutils
Version: 24
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Petr Lautrbach
QA Contact: Fedora Extras Quality Assurance
URL: https://retrace.fedoraproject.org/faf...
Whiteboard: abrt_hash:257b38da2fcdb8bae28bf988046...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-09-15 21:38 UTC by Paul Finnigan
Modified: 2016-12-03 10:56 UTC (History)
4 users (show)

Fixed In Version: policycoreutils-2.5-15.fc24
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-12-03 10:56:54 UTC


Attachments (Terms of Use)
File: backtrace (8.02 KB, text/plain)
2016-09-15 21:38 UTC, Paul Finnigan
no flags Details
File: cgroup (244 bytes, text/plain)
2016-09-15 21:38 UTC, Paul Finnigan
no flags Details
File: core_backtrace (2.75 KB, text/plain)
2016-09-15 21:38 UTC, Paul Finnigan
no flags Details
File: dso_list (1.30 KB, text/plain)
2016-09-15 21:38 UTC, Paul Finnigan
no flags Details
File: environ (245 bytes, text/plain)
2016-09-15 21:38 UTC, Paul Finnigan
no flags Details
File: limits (1.29 KB, text/plain)
2016-09-15 21:38 UTC, Paul Finnigan
no flags Details
File: maps (5.53 KB, text/plain)
2016-09-15 21:39 UTC, Paul Finnigan
no flags Details
File: mountinfo (3.48 KB, text/plain)
2016-09-15 21:39 UTC, Paul Finnigan
no flags Details
File: namespaces (102 bytes, text/plain)
2016-09-15 21:39 UTC, Paul Finnigan
no flags Details
File: open_fds (183 bytes, text/plain)
2016-09-15 21:39 UTC, Paul Finnigan
no flags Details
File: proc_pid_status (1.08 KB, text/plain)
2016-09-15 21:39 UTC, Paul Finnigan
no flags Details
File: var_log_messages (28 bytes, text/plain)
2016-09-15 21:39 UTC, Paul Finnigan
no flags Details

Description Paul Finnigan 2016-09-15 21:38:47 UTC
Description of problem:
No Idea.

Version-Release number of selected component:
policycoreutils-2.5-13.fc24

Additional info:
reporter:       libreport-2.7.2
backtrace_rating: 4
cmdline:        /sbin/restorecon //etc/sysconfig/networking/profiles//default/resolv.conf
crash_function: realpath_not_final
executable:     /usr/sbin/setfiles
global_pid:     3859
kernel:         4.7.2-201.fc24.x86_64
pkg_fingerprint: 73BD E983 81B4 6521
pkg_vendor:     Fedora Project
runlevel:       N 5
type:           CCpp
uid:            0

Truncated backtrace:
Thread no. 1 (3 frames)
 #6 realpath_not_final at matchpathcon.c:406
 #7 process_one_realpath at restore.c:425
 #8 process_glob at restore.c:391

Comment 1 Paul Finnigan 2016-09-15 21:38:53 UTC
Created attachment 1201426 [details]
File: backtrace

Comment 2 Paul Finnigan 2016-09-15 21:38:54 UTC
Created attachment 1201427 [details]
File: cgroup

Comment 3 Paul Finnigan 2016-09-15 21:38:55 UTC
Created attachment 1201428 [details]
File: core_backtrace

Comment 4 Paul Finnigan 2016-09-15 21:38:57 UTC
Created attachment 1201429 [details]
File: dso_list

Comment 5 Paul Finnigan 2016-09-15 21:38:58 UTC
Created attachment 1201430 [details]
File: environ

Comment 6 Paul Finnigan 2016-09-15 21:38:59 UTC
Created attachment 1201431 [details]
File: limits

Comment 7 Paul Finnigan 2016-09-15 21:39:01 UTC
Created attachment 1201432 [details]
File: maps

Comment 8 Paul Finnigan 2016-09-15 21:39:02 UTC
Created attachment 1201433 [details]
File: mountinfo

Comment 9 Paul Finnigan 2016-09-15 21:39:03 UTC
Created attachment 1201434 [details]
File: namespaces

Comment 10 Paul Finnigan 2016-09-15 21:39:05 UTC
Created attachment 1201435 [details]
File: open_fds

Comment 11 Paul Finnigan 2016-09-15 21:39:06 UTC
Created attachment 1201436 [details]
File: proc_pid_status

Comment 12 Paul Finnigan 2016-09-15 21:39:08 UTC
Created attachment 1201437 [details]
File: var_log_messages

Comment 13 Vit Mojzis 2016-10-21 10:53:00 UTC
Would you be able to provide more information about the issue? 
Specifically the following would be helpfull:
   What were you doing when the issue occured?
   Are you able to reproduce it?
   Is the rest of the system up to date (libselinux)?

Comment 14 Paul Finnigan 2016-10-24 22:08:07 UTC
I am trying to come up with more information. Every 4 hours or so I get a CPU halting. Things continue running on the single core that is left but any call to systemd hangs, so reboot or poweroff are not possible. In fact any diagnostics I have tried have failed to produce any output I could save.

I have been using docker to run services, currently I am playing around with samba, apache, postgres and jasperserver in an attempt to provide test service environments.

There are two things that could cause network configuration changes as appears to have been happening. The first is me restarting containers, with perhaps changes on the ports used and firewalls. The second is that I have two wireless networks I connect to that can access the server, so the laptop path changes (IPs should remain the same).

The system is a new system built about two months ago. It is updated about once or twice a week. The Docker images are also rebuilt on a regular basis.

On the particular question of libselinux I have set selinux mode to permissive due to the number of problems I am having with docker containers. With the intention of switching it back on and fixing when the services are presented to the world. 

I hope this helps. If you need more details and can tell me what you want then I will get back to you as soon as I can.

Comment 15 Petr Lautrbach 2016-10-25 07:25:10 UTC
Thanks for the report. A reproducer for this issue is quite simple:

$ ln -s /etc/resolv.conf $HOME

$ matchpathcon /$HOME/resolv.conf
*** Error in `matchpathcon': free(): invalid pointer: 0x00000000008068b1 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x7c503)[0x7fa9a19dc503]
/lib64/libselinux.so.1(realpath_not_final+0xc0)[0x7fa9a1d36d50]
/lib64/libselinux.so.1(matchpathcon+0xce)[0x7fa9a1d36eee]
matchpathcon[0x401215]
matchpathcon[0x400f68]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x7fa9a1981b35]
matchpathcon[0x4010f2]


or

$ restorecon /$HOME/resolv.conf  
*** Error in `restorecon': free(): invalid pointer: 0x00007f127c44b5f1 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x7c503)[0x7f127abb6503]
/lib64/libselinux.so.1(realpath_not_final+0xc0)[0x7f127b3d0d50]
restorecon(+0x39fb)[0x7f127b8079fb]
restorecon(+0x3bab)[0x7f127b807bab]
restorecon(+0x2443)[0x7f127b806443]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x7f127ab5bb35]
restorecon(+0x264f)[0x7f127b80664f]

Comment 16 Petr Lautrbach 2016-10-25 07:38:46 UTC
The problem is in realpath_not_final():

350 int realpath_not_final(const char *name, char *resolved_path)
351 {
...
357         tmp_path = strdup(name);
...
365         /* strip leading // */
366         while (tmp_path[len] && tmp_path[len] == '/' &&
367                tmp_path[len+1] && tmp_path[len+1] == '/') {
368                 tmp_path++;
369                 len++;
370         }

tmp_path pointer is moved forward.

405 out:
406         free(tmp_path);
407         return rc;
408 }

and here is an attempt to free() the moved pointer.

Comment 17 Vit Mojzis 2016-10-25 14:43:15 UTC
Pull request:
https://github.com/fedora-selinux/selinux/pull/30

Please use the following scratch build until fixed package is available.
http://koji.fedoraproject.org/koji/taskinfo?taskID=16196593

Comment 18 Paul Finnigan 2016-11-01 21:09:09 UTC
The fix appears to clear up a number of probelms I had with SELinux. I have been running with SELinux enabled for a few days without any problems.

Thanks

Comment 19 Petr Lautrbach 2016-11-02 11:33:39 UTC
Thanks for the testing!

Upstream commit - https://github.com/SELinuxProject/selinux/commit/0776dca5758af7c64435c7cead44517e768e5a52

Comment 20 Fedora Update System 2016-11-22 16:53:06 UTC
libselinux-2.5-13.fc25 policycoreutils-2.5-18.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2016-17b60ec8d1

Comment 21 Fedora Update System 2016-11-22 22:53:28 UTC
secilc-2.5-6.fc24 checkpolicy-2.5-8.fc24 policycoreutils-2.5-15.fc24 libsemanage-2.5-6.fc24 libselinux-2.5-12.fc24 libsepol-2.5-10.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-e780970d04

Comment 22 Fedora Update System 2016-11-23 23:07:37 UTC
libselinux-2.5-13.fc25, policycoreutils-2.5-18.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-17b60ec8d1

Comment 23 Fedora Update System 2016-11-25 09:38:36 UTC
checkpolicy-2.5-8.fc24, libselinux-2.5-12.fc24, libsemanage-2.5-6.fc24, libsepol-2.5-10.fc24, policycoreutils-2.5-15.fc24, secilc-2.5-6.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-e780970d04

Comment 24 Fedora Update System 2016-11-30 05:28:45 UTC
libselinux-2.5-13.fc25, policycoreutils-2.5-18.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.

Comment 25 Fedora Update System 2016-12-03 10:56:54 UTC
checkpolicy-2.5-8.fc24, libselinux-2.5-12.fc24, libsemanage-2.5-6.fc24, libsepol-2.5-10.fc24, policycoreutils-2.5-15.fc24, secilc-2.5-6.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.


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