Bug 120061 - make modules_install fails when calling depmod because of SELinux
make modules_install fails when calling depmod because of SELinux
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: policy (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Daniel Walsh
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-04-05 14:12 EDT by Albert Strasheim
Modified: 2007-11-30 17:10 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-04-07 10:41:43 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Albert Strasheim 2004-04-05 14:12:13 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040312

Description of problem:
I compile the kernel as root (root:sysadm_r:sysadm_t policy). The last
step of the kernel compilation is to run depmod like so:

/sbin/depmod -ae -F System.map 2.6.4-1.305custom

This produces the following error:

FATAL: Could not open 'System.map': Permission denied

The following message appears in /var/log/messages:

Apr  5 20:05:14 asok kernel: audit(1081188314.313:0): avc:  denied  {
search } for  pid=31859 exe=/sbin/depmod name=linux-2.6.4-1.305
dev=hda5 ino=33 scontext=root:sysadm_r:depmod_t
tcontext=system_u:object_r:src_t tclass=dir

With setenforce 0, everything works fine.

Version-Release number of selected component (if applicable):
kernel-source-2.6.4-1.305 

How reproducible:
Always

Steps to Reproduce:
1. Configure and compile custom kernel
2. make modules_install

Actual Results:  depmod fails

Expected Results:  depmod should work

Additional info:
Comment 1 Daniel Walsh 2004-04-05 15:37:52 EDT
Could you see if adding this

r_dir_file(depmod_t, src_t)

to 
/etc/security/selinux/src/policy/domains/program/modutile.te
and then do a 
make load
fixes the problem.
Comment 2 Albert Strasheim 2004-04-05 20:43:46 EDT
Yep, adding the line above to modutil.te included with
policy-sources-1.9.2-9 at line 46 fixes the problem.

Without the line, I would get the following error in /var/log/messages:

Apr  6 02:48:48 asok kernel: audit(1081212528.277:0): avc:  denied  {
search } for  pid=3040 exe=/sbin/depmod name=linux-2.6.4-1.305
dev=hda5 ino=33 scontext=root:sysadm_r:depmod_t
tcontext=system_u:object_r:src_t tclass=dir
Comment 3 Daniel Walsh 2004-04-05 23:06:42 EDT
Fixed in policy-1.9.2-12
Comment 4 Albert Strasheim 2004-04-07 10:15:26 EDT
Yep, works for me.

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