Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 415955 - sys-fs/udisks should depend on selinux-devicekit
Summary: sys-fs/udisks should depend on selinux-devicekit
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Hardened (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Sven Vermeulen (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-14 14:59 UTC by Paweł Hajdan, Jr. (RETIRED)
Modified: 2012-12-09 10:43 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2012-05-14 14:59:22 UTC
[73377.166933] type=1400 audit(1337005455.471:136048722): avc:  denied  { execute } for  pid=20871 comm="dbus-daemon-lau" name="udisks-daemon" dev="sda1" ino=564037 scontext=system_u:system_r:system_dbusd_t tcontext=system_u:object_r:bin_t tclass=file

May 14 16:24:15 localhost dbus[4585]: [system] Activating service name='org.freedesktop.UDisks' (using servicehelper)
May 14 16:24:15 localhost dbus[4585]: [system] Activated service 'org.freedesktop.UDisks' failed: Cannot launch daemon, file not found or permissions invalid

audit2allow:

allow system_dbusd_t bin_t:file execute;

# qlist -ICv sec-policy
sec-policy/selinux-base-2.20120215-r7
sec-policy/selinux-base-policy-2.20120215-r7
sec-policy/selinux-consolekit-2.20120215
sec-policy/selinux-cups-2.20120215
sec-policy/selinux-dbus-2.20120215
sec-policy/selinux-desktop-2.20110726
sec-policy/selinux-dhcp-2.20120215-r5
sec-policy/selinux-gnupg-2.20101213-r2
sec-policy/selinux-gpg-2.20120215
sec-policy/selinux-java-2.20120215
sec-policy/selinux-lpd-2.20120215
sec-policy/selinux-mono-2.20120215
sec-policy/selinux-mplayer-2.20120215
sec-policy/selinux-ntp-2.20120215
sec-policy/selinux-policykit-2.20120215
sec-policy/selinux-vmware-2.20120215
sec-policy/selinux-wine-2.20120215
sec-policy/selinux-wm-2.20120215
sec-policy/selinux-xfs-2.20120215
sec-policy/selinux-xserver-2.20120215

Portage 2.1.10.49 (hardened/linux/amd64/selinux, gcc-4.5.3, glibc-2.14.1-r3, 3.2.2-hardened-r1 x86_64)
=================================================================
System uname: Linux-3.2.2-hardened-r1-x86_64-Intel-R-_Core-TM-2_Duo_CPU_P8700_@_2.53GHz-with-gentoo-2.0.3
Timestamp of tree: Tue, 08 May 2012 10:00:01 +0000
app-shells/bash:          4.2_p20
dev-lang/python:          2.7.2-r3, 3.2.2
dev-util/cmake:           2.8.6-r4
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.0.3
sys-apps/openrc:          0.9.8.4
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.11.1
sys-devel/binutils:       2.21.1-r1
sys-devel/gcc:            4.5.3-r2
sys-devel/gcc-config:     1.5-r2
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r1
sys-kernel/linux-headers: 3.1 (virtual/os-headers)
sys-libs/glibc:           2.14.1-r3
Repositories: gentoo x-portage
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles news parallel-fetch protect-owned sandbox selinux sesandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X alsa amd64 berkdb bzip2 cli consolekit cracklib crypt cups cxx dbus dri gdbm gdu gudev hardened iconv icu jpeg justify libkms mmx modules mudflap multilib ncurses nls nptl open_perms openmp pam pax_kernel pcre policykit pppd python readline selinux session sse sse2 ssl startup-notification tcpd thunar udev unicode urandom xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="intel vesa vmware" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 Sven Vermeulen (RETIRED) gentoo-dev 2012-07-06 16:14:04 UTC
How do you have it start udisks? I installed it and started dbus, but apart from dbus now running, I don't see udisks running nor do I see a failure in the avc logs...
Comment 2 Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2012-07-31 13:33:37 UTC
(In reply to comment #1)
> How do you have it start udisks? I installed it and started dbus, but apart
> from dbus now running, I don't see udisks running nor do I see a failure in
> the avc logs...

I don't know... I didn't explicitly configure udisks. Here are some things I guess might help:

$ rc-status
Runlevel: default
 vmware-tools                                                                                                                         [  started  ]
 dbus                                                                                                                                 [  started  ]
 net.eth0                                                                                                                             [  started  ]
 netmount                                                                                                                             [  started  ]
 syslog-ng                                                                                                                            [  started  ]
 postfix                                                                                                                              [  started  ]
 consolekit                                                                                                                           [  started  ]
 xdm                                                                                                                                  [  started  ]
 udev-postmount                                                                                                                       [  started  ]
 local                                                                                                                                [  started  ]
Dynamic Runlevel: hotplugged
Dynamic Runlevel: needed
 udev-mount                                                                                                                           [  started  ]
 xdm-setup                                                                                                                            [  started  ]
Dynamic Runlevel: manual

$ equery depends udisks
 * These packages depend on udisks:
sys-apps/gnome-disk-utility-3.0.2-r200 (=sys-fs/udisks-1.0*:0[remote-access?])
$ equery depends gnome-disk-utility
 * These packages depend on gnome-disk-utility:
gnome-base/gvfs-1.10.1 (gdu ? =sys-apps/gnome-disk-utility-3.0.2-r300)
                       (gdu ? =sys-apps/gnome-disk-utility-3.0.2-r200)
$ equery depends gvfs              
 * These packages depend on gvfs:
media-gfx/gimp-2.6.12 (gnome ? gnome-base/gvfs)
xfce-base/thunar-1.4.0 (dbus ? >=gnome-base/gvfs-1.10.1)
                       (udev ? >=gnome-base/gvfs-1.10.1[udisks,udev])
                       (udev ? >=gnome-base/gvfs-1.10.1[gdu,udev])
                       (xfce_plugins_trash ? >=gnome-base/gvfs-1.10.1)

And I have thunar and gimp in my world file. I'm using XFCE, so maybe some usage of Thunar triggered it, I'm not sure yet. Hopefully that's helpful, try installing thunar and launching it and see what happens. Please let me know if you need more info.
Comment 3 Jory A. Pratt gentoo-dev 2012-07-31 13:51:44 UTC
(In reply to comment #1)
> How do you have it start udisks? I installed it and started dbus, but apart
> from dbus now running, I don't see udisks running nor do I see a failure in
> the avc logs...

udisk is started via xinitrc usually. This could very well be fixed with the /run changes.
Comment 4 Sven Vermeulen (RETIRED) gentoo-dev 2012-08-15 15:27:46 UTC
From the policy sources, it looks like we should create a policy for the udisks daemon and then "dbus_system_domain(udisks_t, udisks_exec_t)" or something like that. That'll allow dbus to execute the command and transition to the domain.

I don't feel like allowing dbus to execute bin_t.
Comment 5 Sven Vermeulen (RETIRED) gentoo-dev 2012-12-03 10:53:56 UTC
Looks like udisks is covered by devicekit. I'll try with this policy installed and see if the file contexts are ok. I'll also have the package depend on selinux-devicekit properly.
Comment 6 Sven Vermeulen (RETIRED) gentoo-dev 2012-12-09 10:43:08 UTC
sys-fs/udisks has been updated with selinux? ( sec-policy/selinux-devicekit) dependency. Contexts in the devicekit module seem to be accurate.