Bug 232229 - [LSPP] Python segfaults with 'getfilecon' in i386
Summary: [LSPP] Python segfaults with 'getfilecon' in i386
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: libselinux
Version: 5.0
Hardware: i386
OS: Linux
medium
high
Target Milestone: ---
: ---
Assignee: Daniel Walsh
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: RHEL5LSPPCertTracker
TreeView+ depends on / blocked
 
Reported: 2007-03-14 14:41 UTC by Klaus Kiwi (Old account no longer used)
Modified: 2018-08-29 13:55 UTC (History)
4 users (show)

Fixed In Version: RHBA-2007-0541
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-11-07 16:37:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2007:0541 0 normal SHIPPED_LIVE libselinux bug fix update 2007-10-30 16:11:15 UTC

Description Klaus Kiwi (Old account no longer used) 2007-03-14 14:41:28 UTC
Description of problem:
In i386, if I try to 'getfilecon' a file which SELinux prohibits access, python
dies with 'segfault':

[testuser/user_r/SystemLow@rhel5 ~]$ id
uid=501(testuser) gid=501(testuser) groups=501(testuser)
context=testuser_u:user_r:user_t:SystemLow-SystemHigh
[testuser/user_r/SystemLow@rhel5 ~]$ python
Python 2.4.3 (#1, Dec 11 2006, 11:38:52)
[GCC 4.1.1 20061130 (Red Hat 4.1.1-43)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import selinux
>>> selinux.getfilecon('/dev/usb/lp0')
Segmentation fault
[testuser/user_r/SystemLow@rhel5 ~]$ python
Python 2.4.3 (#1, Dec 11 2006, 11:38:52)
[GCC 4.1.1 20061130 (Red Hat 4.1.1-43)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import selinux
>>> selinux.getfilecon('/root/.ssh')
Segmentation fault
[testuser/user_r/SystemLow@rhel5 ~]$ 


== Relevant(?) audit messages: ==
type=SYSCALL msg=audit(1173896641.831:624): arch=40000003 syscall=229 success=no
exit=-13 a0=b7ec78a4 a1=4612b3 a2=9d16498 a3=ff items=1 ppid=14687 pid=14716
auid=501 uid=501 gid=501 euid=501 suid=501 fsuid=501 egid=501 sgid=501 fsgid=501
tty=pts0 comm="python" exe="/usr/bin/python"
subj=testuser_u:user_r:user_t:s0-s15:c0.c1023 key=(null)
type=CWD msg=audit(1173896641.831:624):  cwd="/home/testuser"
type=PATH msg=audit(1173896641.831:624): item=0 name="/dev/usb/lp0" inode=5662
dev=00:10 mode=020660 ouid=0 ogid=7 rdev=b4:00
obj=system_u:object_r:printer_device_t:s0




Version-Release number of selected component (if applicable):
libselinux-python-1.33.4-2.el5

How reproducible:
always

Steps to Reproduce:
See Description
  
Actual results:
Segfault

Expected results:
something like [-1, '']

Additional info:
The strange thing is that I could only reproduce this on i386
x86_64 and ppc64 seems fine:

[testuser/user_r/SystemLow@zaphod ~]$ python
Python 2.4.3 (#1, Dec 11 2006, 11:40:12)
[GCC 4.1.1 20061130 (Red Hat 4.1.1-43)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import selinux
>>> selinux.getfilecon('/root/.ssh')
[-1, '']
>>>   

Although i386 is not in the LSPP evaluation, this bug is causing impact on test
development

I can to debug further if the relevant debuginfo files are made available

Comment 1 Daniel Walsh 2007-03-19 14:33:25 UTC
Fixed in libselinux-1.33.4-4.el5.i386.rpm

Comment 7 errata-xmlrpc 2007-11-07 16:37:31 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2007-0541.html



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