Bug 477764

Summary: /sbin/restorecon generate coredump when truing restore /var/run/sm-client.pid
Product: [Fedora] Fedora Reporter: Artur Penttinen <artur+redhat.com>
Component: policycoreutilsAssignee: Daniel Walsh <dwalsh>
Status: CLOSED WORKSFORME QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: low    
Version: 10CC: drepper, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Fedora 10
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-06-26 19:58:42 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Strace log and content of /etc/selinux/targeted/contexts/files none

Description Artur Penttinen 2008-12-23 14:24:13 UTC
Description of problem:


Version-Release number of selected component (if applicable):
policycoreutils-2.0.57-14.fc10.i386

How reproducible:

Try restart sendmail:

Steps to Reproduce:
1. sudo make -C /etc/mail restart
2.
3.
  
Actual results:

/sbin/restorecon generate coredump.

Expected results:

Will restart sendmail.

Additional info:

# gdb /sbin/restorecon core.*
...
Core was generated by `/sbin/restorecon /var/run/sm-client.pid'.
Program terminated with signal 11, Segmentation fault.
[New process 18690]
#0  0x400171eb in call_init () at dl-init.c:70
70            init (argc, argv, env);
(gdb) bt
#0  0x400171eb in call_init () at dl-init.c:70
#1  _dl_init (main_map=0x40029658, argc=2, argv=0xbfef1984, env=0xbfef1990) at dl-init.c:134
#2  0x4000788f in _dl_start_user () from /lib/ld-linux.so.2
(gdb)

Comment 1 Daniel Walsh 2008-12-23 16:19:21 UTC
This seems like it might be caused by a lower layer library.  I have not heard of restorecon crashing for any reason.

Comment 2 Daniel Walsh 2008-12-23 16:19:51 UTC
Does restorecon crash all the time or just when run within this make?

Comment 3 Artur Penttinen 2008-12-29 10:41:51 UTC
yes:

# sudo /sbin/restorecon /var/run/sm-client.pid
[1]    21507 segmentation fault (core dumped)  sudo /sbin/restorecon /var/run/sm-client.pid
#

Comment 4 Daniel Walsh 2009-01-04 17:41:26 UTC
What does 

# id -Z

Show?

Does this happen in permissive mode?

Comment 5 Artur Penttinen 2009-01-05 06:49:15 UTC
# id -Z
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
#

Comment 6 Daniel Walsh 2009-01-05 20:25:53 UTC
Does this happen if you are in permissive mode?

# setenforce 0
# sudo /sbin/restorecon /var/run/sm-client.pid

Could you also get the output from

# sudo strace /sbin/restorecon /var/run/sm-client.pid

Comment 7 Daniel Walsh 2009-01-05 20:27:38 UTC
Also please attach the contents of 

/etc/selinux/targeted/contexts/files/

Might be something here causing the problem.

Does matchpatchcon /var/run/sm-client.pid

work?

Comment 8 Artur Penttinen 2009-01-07 06:36:54 UTC
Hm. After enforcing to permissive mode (though it already was), all began to work normally.
Just in case I attach strace log and content of /etc/selinux/targeted/contexts/files/.

# matchpathcon /var/run/sm-client.pid
/var/run/sm-client.pid  system_u:object_r:sendmail_var_run_t:s0
#

Comment 9 Artur Penttinen 2009-01-07 06:39:19 UTC
Created attachment 328349 [details]
Strace log and content of /etc/selinux/targeted/contexts/files

Comment 10 Daniel Walsh 2009-01-07 18:37:25 UTC
So are you saying this blows up in enforcing mode and not in permissive mode?

I think you have a labeling problem, I would put the machine in permissive mode and the run 

# fixfiles restore