Bug 253537

Summary: avc: denied { getattr } for comm="named" path="/dev/random"
Product: Red Hat Enterprise Linux 5 Reporter: Milan Zázrivec <mzazrivec>
Component: bindAssignee: Adam Tkac <atkac>
Status: CLOSED ERRATA QA Contact: Ben Levenson <benl>
Severity: low Docs Contact:
Priority: low    
Version: 5.1CC: atodorov, dwalsh, ovasik
Target Milestone: ---Keywords: EasyFix, Patch, Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHSA-2008-0300 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-05-21 14:17:46 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
audit.log
none
proposed patch none

Description Milan Zázrivec 2007-08-20 14:17:05 UTC
Description of problem:
Starting of named on RHEL5.1-Server-20070817.0 produces
avc denial.

Version-Release number of selected component (if applicable):
RHEL5.1-Server-20070817.0 / selinux-policy-targeted-2.4.6-83.el5

How reproducible:
Always

Steps to Reproduce:
1. Install RHEL5.1-Server-20070817.0 (with named)
2. After successful install and reboot: /etc/init.d/named start
  
Actual results:
Attachment

Comment 1 Milan Zázrivec 2007-08-20 14:17:05 UTC
Created attachment 161876 [details]
audit.log

Comment 2 Daniel Walsh 2007-08-20 19:51:28 UTC
For some reason /dev/random is labeled incorrectly.
Probably in the chroot environment.

restorecon -R -v /var/named


Comment 3 Milan Zázrivec 2007-08-21 08:10:51 UTC
restorecon -R -v /var/named helps, but since this was a new
install, relabeling just to make this denial disappear is
not acceptable.

Reopening and reassigning to bind.



Comment 4 Adam Tkac 2007-08-21 13:34:36 UTC
problem is that /dev/random is mislabeled during installation so
/usr/bin/chcon --reference=/dev/random ${BIND_CHROOT_PREFIX}/dev/random;
makes ${BIND_CHROOT_PREFIX}/dev/random mislabeled

Comment 5 Adam Tkac 2007-08-21 13:36:36 UTC
Created attachment 161970 [details]
proposed patch

use restorecon instead chcon

Comment 6 Adam Tkac 2007-08-21 13:40:56 UTC
Adding to 5.2 proposed

For QA:

try install bind-chroot in default installation (with enabled selinux). Old
package has mislabeled /dev/random in chroot

Comment 7 RHEL Program Management 2007-10-16 03:46:45 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 10 Adam Tkac 2008-02-08 09:48:26 UTC
*** Bug 431202 has been marked as a duplicate of this bug. ***

Comment 11 Milan Zázrivec 2008-02-13 11:58:43 UTC
Verified with RHEL5.2-Server-20080212.0 / bind-chroot-9.3.4-4.P1.el5

Comment 13 errata-xmlrpc 2008-05-21 14:17:46 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/RHSA-2008-0300.html