Bug 150301 - fixfiles segmentation fult
fixfiles segmentation fult
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: policycoreutils (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Daniel Walsh
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-03-04 10:01 EST by John Ellson
Modified: 2007-11-30 17:11 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-03-14 11:33:54 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
output of: sh -x fixfiles restore (1.16 KB, text/plain)
2005-03-07 19:10 EST, John Ellson
no flags Details
cut&paste of gdb stack (1.63 KB, text/plain)
2005-03-07 19:19 EST, John Ellson
no flags Details
cut&paste of gdb stack - w libselinux debuginfo (1.70 KB, text/plain)
2005-03-07 19:37 EST, John Ellson
no flags Details
Patch for bug in matchpathcon_filespec_add (615 bytes, patch)
2005-03-08 11:43 EST, Stephen Smalley
no flags Details | Diff

  None (edit)
Description John Ellson 2005-03-04 10:01:28 EST
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 12:04:43 EST
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 13:14:29 EST
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 13:48:11 EST
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 14:35:35 EST
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 17:10:17 EST
Ok could you try sh -x fixfiles restore

What is segfaulting?


Dan
Comment 6 John Ellson 2005-03-07 19:10:40 EST
Created attachment 111763 [details]
output of: sh -x fixfiles restore
Comment 7 John Ellson 2005-03-07 19:19:39 EST
Created attachment 111764 [details]
cut&paste of gdb stack

Its something strange with /boot
Comment 8 John Ellson 2005-03-07 19:37:06 EST
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 11:43:42 EST
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 15:16:43 EST
Fixed in libselinux-1.21.13-1
Comment 11 John Ellson 2005-03-14 10:17:07 EST
Works for me (libselinux-1.22-1).  Thanks everyone.

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