Bug 150301

Summary: fixfiles segmentation fult
Product: [Fedora] Fedora Reporter: John Ellson <john.ellson>
Component: policycoreutilsAssignee: Daniel Walsh <dwalsh>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: dwalsh, pgraner, sdsmall
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-03-14 16:33:54 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
output of: sh -x fixfiles restore
none
cut&paste of gdb stack
none
cut&paste of gdb stack - w libselinux debuginfo
none
Patch for bug in matchpathcon_filespec_add none

Description John Ellson 2005-03-04 15:01:28 UTC
Description of problem:
root@ontap:~# fixfiles relabel

    Files in the /tmp directory may be labeled incorrectly, this command
    can remove all files in /tmp.  If you choose to remove files from
/tmp,
    a reboot will be required after completion.

    Do you wish to clean out the /tmp directory [N]?
/sbin/fixfiles: line 104:  4491 Segmentation fault      ${SETFILES}
${OUTFILES} ${SYSLOGFLAG} $1 -v ${FC} ${FILESYSTEMSRW} 2>&1 >>$LOGFILE
root@ontap:~#


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


How reproducible:
100%

Steps to Reproduce:
1.fixfile rebabel
2.
3.
  
Actual results:
/sbin/fixfiles: line 104:  4491 Segmentation fault      ${SETFILES}
${OUTFILES} ${SYSLOGFLAG} $1 -v ${FC} ${FILESYSTEMSRW} 2>&1 >>$LOGFILE

Expected results:
no crash

Additional info:

Comment 1 Daniel Walsh 2005-03-07 17:04:43 UTC
I can not replicate this.  Could you attach the contents of your
/etc/fstab?

Is there anything unusual in there?

Dan

Comment 2 John Ellson 2005-03-07 18:14:29 UTC
I don't think there is anything unusual, unless you count software raid?


ellson@ontap:~> cat /etc/fstab
# This file is edited by fstab-sync - see 'man fstab-sync' for details
/dev/VolGroup00/LogVol00 /                       ext3    defaults    
   1 1
LABEL=/boot             /boot                   ext3    defaults     
  1 2
none                    /dev/pts                devpts  gid=5,mode=620
 0 0
none                    /dev/shm                tmpfs   defaults     
  0 0
none                    /proc                   proc    defaults     
  0 0
none                    /sys                    sysfs   defaults     
  0 0
LABEL=SWAP-sdb1         swap                    swap    defaults     
  0 0
LABEL=SWAP-sda2         swap                    swap    defaults     
  0 0
/dev/hda                /media/cdrecorder       auto   
pamconsole,exec,noauto,fscontext=system_u:object_r:removable_t,managed 0 0
ellson@ontap:~>


Comment 3 Daniel Walsh 2005-03-07 18:48:11 UTC
Ok this is doing a

setfiles /etc/selinux/targeted/contexts/files/file_context /

Which is segfaulting.

Could you try that?  If it does fail 

Could you strace it?

Comment 4 John Ellson 2005-03-07 19:35:35 UTC
Assuming you meant "file_contexts" with an 's', no it doesn't fail.


root@ontap:ellson# setfiles
/etc/selinux/targeted/contexts/files/file_contexts / 
setfiles:  labeling files under /
matchpathcon_filespec_eval:  hash table stats: 1932382 elements,
34979/65536 buc kets used, longest chain length 117
setfiles:  Done.
root@ontap:ellson# rpm -qf /usr/sbin/setfiles
policycoreutils-1.21.20-3
root@ontap:ellson#


Comment 5 Daniel Walsh 2005-03-07 22:10:17 UTC
Ok could you try sh -x fixfiles restore

What is segfaulting?


Dan

Comment 6 John Ellson 2005-03-08 00:10:40 UTC
Created attachment 111763 [details]
output of: sh -x fixfiles restore

Comment 7 John Ellson 2005-03-08 00:19:39 UTC
Created attachment 111764 [details]
cut&paste of gdb stack

Its something strange with /boot

Comment 8 John Ellson 2005-03-08 00:37:06 UTC
Created attachment 111765 [details]
cut&paste of gdb stack - w libselinux debuginfo

The problem does not occur with just "/boot", it needs to be "/ /boot".

Comment 9 Stephen Smalley 2005-03-08 16:43:42 UTC
Created attachment 111783 [details]
Patch for bug in matchpathcon_filespec_add

This patch fixes a bug in matchpathcon_filespec_add; failure to zero the
fl_head array after allocation.

Comment 10 Daniel Walsh 2005-03-08 20:16:43 UTC
Fixed in libselinux-1.21.13-1

Comment 11 John Ellson 2005-03-14 15:17:07 UTC
Works for me (libselinux-1.22-1).  Thanks everyone.