Bug 146694 - restorecon -R / segfaults
restorecon -R / segfaults
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: policycoreutils (Show other bugs)
3
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Daniel Walsh
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-01-31 15:26 EST by Ian Burrell
Modified: 2007-11-30 17:10 EST (History)
3 users (show)

See Also:
Fixed In Version: 1.18.1-2.9
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-09-05 02:54:16 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Ian Burrell 2005-01-31 15:26:04 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5)
Gecko/20041111 Firefox/1.0

Description of problem:
Running 'restorecon -R /' results in a segmentation fault.

I thought this might be related to bug 144666 so I upgraded
policycoreutils to the one in updates-testing.  This didn't fix the
problem.  The '-v' flag makes no difference.

It doesn't segfault on all directories: /dev, /bin succeed. 
'restorecon -R /lib' and /home also segfault.

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

How reproducible:
Always

Additional info:

Backtrace:

#0  ?? () at ../sysdeps/i386/strchr.S:124 from /lib/tls/libc.so.6
#1  0xffffffff in ?? ()
#2  0x08048ea5 in restore (filename=0xbff24050 "/lost+found") at
restorecon.c:56
#3  0x08049072 in apply_spec (file=0x118 "", sb_unused=0xbff251a0,
flag=1, s_unused=0xbff26334)
    at restorecon.c:173
#4  0x00a5e77c in ftw_dir (data=0xbff26320, st=0xbff251a0,
old_dir=0xbff25260) at ftw.c:461
#5  0x00a5ec68 in process_entry (data=0xbff26320, dir=0xbff25260,
name=0x302 "", namlen=1)
    at ftw.c:421
#6  0x00a5e4fe in ftw_dir (data=0xbff26320, st=0xbff262c0,
old_dir=0x0) at ftw.c:498
#7  0x00a5f01d in ftw_startup (dir=0x9a52220 "/lost+found", is_nftw=1,
func=0x804905b,
    descriptors=280, flags=3) at ftw.c:699
#8  0x00a5f1a6 in __new_nftw64 (path=0xbff93b48 "/", func=0x3a3a,
descriptors=280, flags=280)
    at ftw.c:775
#9  0x080490d6 in process (buf=0xbff93b48 "/") at restorecon.c:178
#10 0x08049323 in main (argc=3, argv=0xbff27494) at restorecon.c:251
#11 0x009b8e33 in __libc_start_main (main=0x804911d <main>, argc=3,
ubp_av=0xbff27494,
    init=0x80493ac <__libc_csu_init>, fini=0xbff27420,
rtld_fini=0xbff27494,
    stack_end=0xbff2748c) at ../sysdeps/generic/libc-start.c:209
#12 0x08048a11 in _start ()
Comment 1 Daniel Walsh 2005-01-31 15:33:26 EST
Could you try a 

touch /.autorelabel
reboot 

On this machine.

I think this might be a problem that the system was never labeled in
the first place.

Comment 2 Ian Burrell 2005-01-31 17:57:33 EST
I think the system not being labeled was the base cause.  To fix the
selinux problems I was having, I did:

find / -print | restorecon -f -

Afterwards, 'restorecon -R /' and other directories succeeded without
a segmentation fault.
Comment 3 Daniel Walsh 2005-02-09 10:28:19 EST
Fixed in policycoreutils-1.18.1-2.9

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