This service will be undergoing maintenance at 20:00 UTC, 2017-04-03. It is expected to last about 30 minutes
Bug 199084 - selinux and smba will get access denied messages
selinux and smba will get access denied messages
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: selinux-policy-targeted (Show other bugs)
5
All Linux
medium Severity medium
: ---
: ---
Assigned To: Daniel Walsh
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-07-17 03:35 EDT by Frank Büttner
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version: Current
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-03-28 16:04:17 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 Frank Büttner 2006-07-17 03:35:45 EDT
Description of problem:
when selinux is in enfore mode starting samba will get many acces denied messages

Version-Release number of selected component (if applicable):
selinux-policy-targeted-2.2.47-3.fc5

How reproducible:
run service start smb
 
Actual results:
Samba starts with access denied messages

Expected results:
start without this messages

Additional info:
audit:
Jul 17 09:39:19 kernel: audit(1153121959.170:75): avc:  denied  { setattr } for
 pid=3436 comm=smbd name="smbd" dev=md1 ino=4484854
scontext=user_u:system_r:smbd_t tcontext=system_u:object_r:samba_log_t tclass=dir
Jul 17 09:39:19 kernel: audit(1153121959.170:75): avc:  denied  { setattr } for
 pid=3436 comm=smbd name="smbd" dev=md1 ino=4484854
scontext=user_u:system_r:smbd_t tcontext=system_u:object_r:samba_log_t tclass=dir
Jul 17 09:39:19 kernel: audit(1153121959.254:76): avc:  denied  { search } for 
pid=3436 comm=smbd name="cups" dev=md1 ino=4255697
scontext=user_u:system_r:smbd_t tcontext=system_u:object_r:cupsd_var_run_t
tclass=dir
Jul 17 09:39:19 kernel: audit(1153121959.470:77): avc:  denied  { setattr } for
 pid=3439 comm=nmbd name="nmbd" dev=md1 ino=4484855
scontext=user_u:system_r:nmbd_t tcontext=system_u:object_r:samba_log_t tclass=dir
Jul 17 09:39:19 kernel: audit(1153121959.470:78): avc:  denied  { setattr } for
 pid=3439 comm=nmbd name="nmbd" dev=md1 ino=4484855
scontext=user_u:system_r:nmbd_t tcontext=system_u:object_r:samba_log_t tclass=dir
Comment 1 Carl Roth 2006-07-29 12:21:10 EDT
The relevant statements in samba.te in serefpolicy 2.2.47 are

  allow nmbd_t samba_log_t:dir ra_dir_perms;
  allow nmbd_t samba_log_t:file { create ra_file_perms };

Changing the 'ra_dir_perms' to 'rw_dir_perms' doesn't fix the problem; this is
what smbd_t is set to, and it's also being rejected by selinux.  I suspect this
is related to the new 'cores' subdirectory of /var/log/samba.

The obvious fix here would be to change the statements

  allow smbd_t samba_log_t:dir rw_dir_perms;
  allow nmbd_t samba_log_t:dir ra_dir_perms;

to

  allow smbd_t samba_log_t:dir create_dir_perms;
  allow nmbd_t samba_log_t:dir create_dir_perms;

Comment 2 Daniel Walsh 2006-08-11 15:26:39 EDT
Fixed in  selinux-policy-2.3.6-3.fc5
Comment 3 Daniel Walsh 2007-03-28 16:04:17 EDT
Closing bugs

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