Hide Forgot
Description of problem: inspired by bz#675996 Version-Release number of selected component (if applicable): selinux-policy-targeted-3.7.19-70.el6.noarch selinux-policy-3.7.19-70.el6.noarch How reproducible: always Steps to Reproduce: # cat /proc/partitions major minor #blocks name 94 0 7212240 dasda 94 1 7212144 dasda1 94 4 7212240 dasdb 94 5 7212144 dasdb1 94 8 7212240 dasdc 94 9 7212144 dasdc1 94 12 7212240 dasdd 94 13 7212144 dasdd1 253 0 27308032 dm-0 253 1 1015808 dm-1 253 2 512000 dm-2 # find /dev -context *:device_t:* \( -type c -o -type b \) -printf "%p %Z\n" /dev/dasd_eer system_u:object_r:device_t:s0 #
What ever created these is not labelling them correctly, or udev is not labeling them. matchpathcon /dev/dm-0 /dev/dm-0 system_u:object_r:fixed_disk_device_t:s0 matchpathcon /dev/dasda /dev/dasda system_u:object_r:fixed_disk_device_t:s0
(In reply to comment #0) > Description of problem: > inspired by bz#675996 > > Version-Release number of selected component (if applicable): > selinux-policy-targeted-3.7.19-70.el6.noarch > selinux-policy-3.7.19-70.el6.noarch > > How reproducible: > always > > Steps to Reproduce: > # cat /proc/partitions > major minor #blocks name > > 94 0 7212240 dasda > 94 1 7212144 dasda1 > 94 4 7212240 dasdb > 94 5 7212144 dasdb1 > 94 8 7212240 dasdc > 94 9 7212144 dasdc1 > 94 12 7212240 dasdd > 94 13 7212144 dasdd1 > 253 0 27308032 dm-0 > 253 1 1015808 dm-1 > 253 2 512000 dm-2 > # find /dev -context *:device_t:* \( -type c -o -type b \) -printf "%p %Z\n" > /dev/dasd_eer system_u:object_r:device_t:s0 > # what is /dev/dasd_eer ??? # ls -l /dev/dasd_eer
# matchpathcon /dev/dasd_err /dev/dasd_err system_u:object_r:fixed_disk_device_t:s0 It's a char device.. # ls -lZ /dev/dasd_eer crw-rw----. root root system_u:object_r:device_t:s0 /dev/dasd_eer # rm /dev/dasd_eer # echo add > /sys/devices/virtual/misc/dasd_eer/uevent # ls -lZ /dev/dasd_eer crw-rw----. root root system_u:object_r:device_t:s0 /dev/dasd_eer Hmm... but udev definitely calls (ltrace) [pid 922] matchpathcon(0x8003b040, 8624, 0x3ffffe87688, 0x200001d0638, 0) = 0 [pid 922] setfscreatecon(0x8003b060, 0x200000eae66, 0x2000004379e, 0x8003b050, 0) = 0 [pid 922] freecon(0x8003b060, 0x2000020af90, 0x200000497c4, 49, 0) = 0x80043770 [pid 922] __xmknod(0, 0x8003b040, 8624, 0x3ffffe877f8, 0) = 0 [pid 922] setfscreatecon(0, 8624, 2619, 0x3ffffe877f8, 0) = 0 [pid 922] chmod("/dev/dasd_eer", 020660) = 0 [pid 922] chown("/dev/dasd_eer", 0, 0) = 0 strace: [pid 922] open("/selinux/context", O_RDWR) = 3 [pid 922] write(3, "system_u:object_r:device_t:s0\0", 30) = 30 [pid 922] read(3, "system_u:object_r:device_t:s0\0", 4095) = 30 [pid 922] close(3) = 0 [pid 922] gettid() = 922 [pid 922] open("/proc/self/task/922/attr/fscreate", O_RDWR) = 3 [pid 922] write(3, "system_u:object_r:device_t:s0\0", 30) = 30 [pid 922] close(3) = 0 [pid 922] mknod("/dev/dasd_eer", S_IFCHR|0660, makedev(10, 59)) = 0 [pid 922] gettid() = 922 [pid 922] open("/proc/self/task/922/attr/fscreate", O_RDWR) = 3 [pid 922] write(3, NULL, 0) = 0
grep /dev/das /etc/selinux/targeted/contexts/files/file_contexts /dev/dasd[^/]* -b system_u:object_r:fixed_disk_device_t:s0 Ok the regex only matches block devices. We need to add /dev/dasd[^/]* -c system_u:object_r:fixed_disk_device_t:s0
Fixed in selinux-policy-3.7.19-71.el6
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 therefore 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-2011-0526.html