Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 210982

Summary: IndexError: list index out of range from rlpkg (part of policycoreutils) while Scanning for shared libraries during converting to SELinux
Product: Gentoo Linux Reporter: gtl4407
Component: HardenedAssignee: Chris PeBenito (RETIRED) <pebenito>
Status: RESOLVED TEST-REQUEST    
Severity: normal CC: sysspoof
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: debug rlpkg

Description gtl4407 2008-02-21 14:58:47 UTC
I am converting an installation to SELinux following the guide at: http://www.gentoo.org/proj/en/hardened/selinux/selinux-handbook.xml

Things have been going well until I try and do the filesystem labeling. Here is a transcript of the problem.

Code:
rlpkg -a -r
Relabeling filesystem types: ext2 ext3 jfs xfs reiserfs
/usr/sbin/setfiles:  labeling files under /
matchpathcon_filespec_eval:  hash table stats: 18647 elements, 16534/65536 buckets used, longest chain length 2
/usr/sbin/setfiles:  labeling files under /boot
matchpathcon_filespec_eval:  hash table stats: 111 elements, 111/65536 buckets used, longest chain length 1
/usr/sbin/setfiles:  labeling files under /usr
matchpathcon_filespec_eval:  hash table stats: 427510 elements, 65536/65536 buckets used, longest chain length 14
/usr/sbin/setfiles:  labeling files under /home
matchpathcon_filespec_eval:  hash table stats: 219859 elements, 61657/65536 buckets used, longest chain length 22
/usr/sbin/setfiles:  labeling files under /var
matchpathcon_filespec_eval:  hash table stats: 82607 elements, 55314/65536 buckets used, longest chain length 4
/usr/sbin/setfiles:  labeling files under /workarea
matchpathcon_filespec_eval:  hash table stats: 9402 elements, 5276/65536 buckets used, longest chain length3
/usr/sbin/setfiles:  labeling files under /root
matchpathcon_filespec_eval:  hash table stats: 61493 elements, 25842/65536 buckets used, longest chain length 9
/usr/sbin/setfiles:  labeling files under /usr/portage
matchpathcon_filespec_eval:  hash table stats: 127371 elements, 60932/65536 buckets used, longest chain length 5
/usr/sbin/setfiles:  labeling files under /var/log
matchpathcon_filespec_eval:  hash table stats: 2988 elements, 2988/65536 buckets used, longest chain length1
/usr/sbin/setfiles:  labeling files under /mnt/index
matchpathcon_filespec_eval:  hash table stats: 80822 elements, 22502/65536 buckets used, longest chain length 22
/usr/sbin/setfiles:  labeling files under /var/tmp
matchpathcon_filespec_eval:  hash table stats: 320730 elements, 53231/65536 buckets used, longest chain length 11
/usr/sbin/setfiles:  labeling files under /tmp
matchpathcon_filespec_eval:  hash table stats: 23549 elements, 23549/65536 buckets used, longest chain length 1
/usr/sbin/setfiles:  labeling files under /opt
matchpathcon_filespec_eval:  hash table stats: 11045 elements, 11045/65536 buckets used, longest chain length 1
/usr/sbin/setfiles:  Done.
Error writing to stat pipe, child exiting.
Error writing to stat pipe, child exiting.
Error writing to stat pipe, child exiting.
Scanning for shared libraries with text relocations...
Traceback (most recent call last):
  File "/usr/sbin/rlpkg", line 312, in ?
    main()
  File "/usr/sbin/rlpkg", line 301, in main
    rc += relabel_textrel_shlib(verbose)
  File "/usr/sbin/rlpkg", line 164, in relabel_textrel_shlib
    if ctx[2] in textrel_ok_relabelfrom:
IndexError: list index out of range



Reproducible: Always

Steps to Reproduce:
rlpkg -a -r 

Actual Results:  
Fails after a while with:
IndexError: list index out of range

Expected Results:  
Should complete without an error
Comment 1 Chris PeBenito (RETIRED) gentoo-dev 2008-02-24 01:56:33 UTC
Created attachment 144473 [details]
debug rlpkg
Comment 2 Chris PeBenito (RETIRED) gentoo-dev 2008-02-24 01:57:06 UTC
Can you try the attached rlpkg, it has additional debug info as I can't reproduce this.
Comment 3 Pat 2008-06-08 17:09:46 UTC
(In reply to comment #2)
> Can you try the attached rlpkg, it has additional debug info as I can't
> reproduce this.
> 

Hi Pebenito

I followed your demand and here is the output:

hypherserv ~ # ./rlpkg_debug -r -t
Scanning for shared libraries with text relocations...
0 libraries with text relocations, 0 not relabeled.
Scanning for PIE binaries with text relocations...
0 binaries with text relocations detected.
hypherserv ~ # rlpkg -t -r
Scanning for shared libraries with text relocations...
Traceback (most recent call last):
  File "/usr/sbin/rlpkg", line 312, in ?
    main()
  File "/usr/sbin/rlpkg", line 301, in main
    rc += relabel_textrel_shlib(verbose)
  File "/usr/sbin/rlpkg", line 164, in relabel_textrel_shlib
    if ctx[2] in textrel_ok_relabelfrom:
IndexError: list index out of range

As you can see, the rlpkg(_debug) attached from you to this bug doesn't break or show something special...
Comment 4 Chris PeBenito (RETIRED) gentoo-dev 2008-10-03 11:23:40 UTC
should be fixed in policycoreutils 2.0