Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 68233 - ls -Z segfaults on unknown contexts
Summary: ls -Z segfaults on unknown contexts
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High minor (vote)
Assignee: Seemant Kulleen (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-19 20:45 UTC by Michael Tindal (RETIRED)
Modified: 2004-12-27 10:23 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch for ls -Z (ls.c.patch,1.16 KB, patch)
2004-10-19 20:49 UTC, Michael Tindal (RETIRED)
Details | Diff
Patch against ls.c (ls.c.patch,1.19 KB, patch)
2004-10-21 21:57 UTC, Michael Tindal (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Tindal (RETIRED) gentoo-dev 2004-10-19 20:45:41 UTC
If a file or directory has an unknown context, ls -Z segfaults when trying to display the context information.  An example of this is /dev on a udev system without tmpfs xattr/security label support.

Reproducible: Always
Steps to Reproduce:
1. ls -Z /
2.
3.

Actual Results:  
Segmentation Fault.


Portage 2.0.51_rc9 (selinux/2004.1/x86, gcc-vanilla, glibc-2.3.4.20041006-r0,
2.6.7-hardened-mt2 i686)
=================================================================
System uname: 2.6.7-hardened-mt2 i686 AMD Athlon(tm) XP 1600+
Gentoo Base System version 1.6.2
ccache version 2.3 [enabled]
Autoconf: sys-devel/autoconf-2.59-r5
Automake: sys-devel/automake-1.8.5-r1
Binutils: sys-devel/binutils-2.15.92.0.2-r1
Headers:  sys-kernel/linux26-headers-2.6.8.1-r1
Libtools: sys-devel/libtool-1.5.2-r5
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-Os -pipe -mtune=athlon-xp -march=athlon-xp -fomit-frame-pointer -msse
-m3dnow -g"
CHOST="i686-pc-linux-gnu"
COMPILER=""
CONFIG_PROTECT="/etc /opt/openjms/config /usr/X11R6/lib/X11/xkb
/usr/kde/2/share/config /usr/kde/3.2/share/config
/usr/kde/3.3/share/config:/usr/kde/3.3/env:/usr/kde/3.3/shutdown
/usr/kde/3/share/config /usr/share/config /usr/share/texmf/dvipdfm/config/
/usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/
/usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control
/var/service"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-Os -pipe -mtune=athlon-xp -march=athlon-xp -fomit-frame-pointer -msse
-m3dnow -g"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs candy ccache collision-protect confcache cvs digest
distclean distlocks flawfinder loadpolicy maketest mirror noinfo nostrip rats
sandbox sfperms sign strict userpriv usersandbox"
GENTOO_MIRRORS="http://gentoo.osuosl.org
http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/opt/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/bmg-main /gentoo/apache-overlay /gentoo/vim-overlay
/gentoo/kernel-overlay /gentoo/kaiowas-overlay /gentoo/kde-overlay"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow X Xaw3d a aalib acl acpi adns aim alsa apache2 audiofile avi berkdb
bindist bonobo bzlib calendar cdr crypt cscope ctype cups dba debug dga dio
directfb divx4linux doc dr dvd emacs esd ethereal evo exif faac faad fam
firebird flac flash foomaticdb ftp gb gd gdbm ggi gif gmp gnome gphoto2 gpm gps
gstreamer gtk gtk2 gtkhtml guile hal icq imagemagick imap imlib inifile innodb
ipv6 jabber java joystick jpeg junit ldap libg++ libwww mad magick maildir mcal
mhash mikmod mime ming mmx mng motif moz mozilla mpeg mpi mpm-threadpool msn
mysql nas ncurses nls odbc offensive oggvorbis openal opengl oscar pam pcntl
pcre pda perl php pic plotutils png posix postgres prelink python readline ruby
samba scheme sdl selinux session shared slang slp snmp soap sockets speex spell
sqlite sse ssl svg svga sysvipc tcltk tcpd tetex theora threads tiff tokenizer
treamer truetype usb v vhosts vos work x x86 xinerama xml xml2 xmlrpc xmlterm
xmms xpm xsl xv xvid yahoo zlib"

I have attached a patch that fixes ls.c to display (unknown context) instead of
segfaulting.
Comment 1 Michael Tindal (RETIRED) gentoo-dev 2004-10-19 20:49:26 UTC
Created attachment 42234 [details, diff]
Patch for ls -Z

This currently prints (null), Im investigating why and will post a new patch
once I have another fix.
Comment 2 Michael Tindal (RETIRED) gentoo-dev 2004-10-21 21:57:05 UTC
Created attachment 42394 [details, diff]
Patch against ls.c

This is a fixed version of ls -Z.  It now exhibits the proper (unknown context)
behavior, rather than segfaulting.  Here is an example of its output:

urilith coreutils-5.2.1 # src/ls -Z /
drwxr-xr-x  root    root    system_u:object_r:bin_t	bin
drwxr-xr-x  root    root    system_u:object_r:boot_t	boot
drwxr-xr-x  root    root    (unknown context)		dev
Comment 3 Chris PeBenito (RETIRED) gentoo-dev 2004-11-10 10:03:03 UTC
seemant: go ahead and drop the selinux+acl patch.  we decided to use.mask acl on the selinux profiles, this this is wontfix or invalid now.
Comment 4 Seemant Kulleen (RETIRED) gentoo-dev 2004-12-27 10:23:50 UTC
spanky bumped the latest coreutils and took out the acl+selinux stuff, as requested.  Thanks Spanks.