Bug 1129706 - SELinux is preventing /usr/sbin/slappasswd from 'execmod' accesses on the file .
Summary: SELinux is preventing /usr/sbin/slappasswd from 'execmod' accesses on the file .
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 20
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:3a91a71216f1350e50f239a3aa5...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-08-13 13:54 UTC by Yajo
Modified: 2015-07-21 11:40 UTC (History)
5 users (show)

Fixed In Version: selinux-policy-3.12.1-182.fc20
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-08-30 03:54:54 UTC


Attachments (Terms of Use)

Description Yajo 2014-08-13 13:54:50 UTC
Description of problem:
As usual, I'm not sure if this is a bug or not, but anyway it's weird that after a `sudo setenforce 0` this alert also is displayed (but works).

I was trying to build Yunohost image according to their website: docker build -t yunohost:init https://raw.githubusercontent.com/YunoHost/Kremlin/master/docker/Dockerfile

At some point it failed. Trace:

Preconfiguring packages ...
Selecting previously unselected package ncurses-term.
(Reading database ... dpkg: warning: files list file for package 'bind9' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'bind9utils' missing; assuming package has no files currently installed
39183 files and directories currently installed.)
Unpacking ncurses-term (from .../ncurses-term_5.9-10_all.deb) ...
Selecting previously unselected package openssh-server.
Unpacking openssh-server (from .../openssh-server_1%3a6.0p1-4+deb7u2_amd64.deb) ...
Selecting previously unselected package ssh.
Unpacking ssh (from .../ssh_1%3a6.0p1-4+deb7u2_all.deb) ...
Setting up slapd (2.4.31-1+nmu2) ...
slappasswd: error while loading shared libraries: cannot restore segment prot after reloc: Permission denied
  Creating initial configuration... Loading the initial configuration from the ldif file () failed with
the following error while running slapadd:
    slapadd: error while loading shared libraries: cannot restore segment prot after reloc: Permission denied
dpkg: error processing slapd (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of yunohost-config-slapd:
 yunohost-config-slapd depends on slapd; however:
  Package slapd is not configured yet.

dpkg: error processing yunohost-config-slapd (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of yunohost-config-others:
 yunohost-config-others depends on yunohost-config-slapd; however:
  Package yunohost-config-slapd is not configured yet.

dpkg: error processing yunohost-config-others (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of yunohost-config-amavis:
 yunohost-config-amavis depends on yunohost-config-slapd; however:
  Package yunohost-config-slapd is not configured yet.

dpkg: error processing yunohost-config-amavis (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of yunohost-config-postfix:
 yunohost-config-postfix depends on yunohost-config-others; however:
  Package yunohost-config-others is not configured yet.
 yunohost-config-postfix depends on yunohost-config-slapd; however:
  Package yunohost-config-slapd is not configured yet.
 yunohost-config-postfix depends on yunohost-config-amavis; however:
  Package yunohost-config-amavis is not configured yet.

dpkg: error processing yunohost-config-postfix (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of yunohost-config-dovecot:
 yunohost-config-dovecot depends on yunohost-config-others; however:
  Package yunohost-config-others is not configured yet.
 yunohost-config-dovecot depends on yunohost-config-slapd; however:
  Package yunohost-config-slapd is not configured yet.
 yunohost-config-dovecot depends on yunohost-config-amavis; however:
  Package yunohost-config-amavis is not configured yet.

dpkg: error processing yunohost-config-dovecot (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of yunohost-config-mysql:
 yunohost-config-mysql depends on yunohost-config-slapd; however:
  Package yunohost-config-slapd is not configured yet.

dpkg: error processing yunohost-config-mysql (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of yunohost-config-nginx:
 yunohost-config-nginx depends on yunohost-config-others; however:
  Package yunohost-config-others is not configured yet.

dpkg: error processing yunohost-config-nginx (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of ssowat:
 ssowat depends on yunohost-config-nginx; however:
  Package yunohost-config-nginx is not configured yet.

dpkg: error processing ssowat (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of yunohost-config:
 yunohost-config depends on yunohost-config-postfix; however:
  Package yunohost-config-postfix is not configured yet.
 yunohost-config depends on yunohost-config-dovecot; however:
  Package yunohost-config-dovecot is not configured yet.
 yunohost-config depends on yunohost-config-others; however:
  Package yunohost-config-others is not configured yet.
 yunohost-config depends on yunohost-config-mysql; however:
  Package yunohost-config-mysql is not configured yet.
 yunohost-config depends on yunohost-config-slapd; however:
  Package yunohost-config-slapd is not configured yet.
 yunohost-config depends on ssowat; however:
  Package ssowat is not configured yet.
 yunohost-config depends on yunohost-config-amavis; however:
  Package yunohost-config-amavis is not configured yet.

dpkg: error processing yunohost-config (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of yunohost:
 yunohost depends on yunohost-config; however:
  Package yunohost-config is not configured yet.

dpkg: error processing yunohost (--configure):
 dependency problems - leaving unconfigured
Setting up ncurses-term (5.9-10) ...
Setting up openssh-server (1:6.0p1-4+deb7u2) ...
Creating SSH2 RSA key; this may take some time ...
Creating SSH2 DSA key; this may take some time ...
Creating SSH2 ECDSA key; this may take some time ...
Restarting OpenBSD Secure Shell server: sshd.
Setting up ssh (1:6.0p1-4+deb7u2) ...
Errors were encountered while processing:
 slapd
 yunohost-config-slapd
 yunohost-config-others
 yunohost-config-amavis
 yunohost-config-postfix
 yunohost-config-dovecot
 yunohost-config-mysql
 yunohost-config-nginx
 ssowat
 yunohost-config
 yunohost
E: Sub-process /usr/bin/dpkg returned an error code (1)
2014/08/13 15:28:41 The command [/bin/sh -c LC_ALL=C DEBIAN_FRONTEND=noninteractive apt-get install ssh -qq -y --force-yes] returned a non-zero code: 100
SELinux is preventing /usr/sbin/slappasswd from 'execmod' accesses on the file .

*****  Plugin catchall (100. confidence) suggests   **************************

If cree que de manera predeterminada, slappasswd debería permitir acceso execmod sobre   file.     
Then debería reportar esto como un error.
Puede generar un módulo de política local para permitir este acceso.
Do
permita el acceso momentáneamente executando:
# grep slappasswd /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:svirt_lxc_net_t:s0:c679,c936
Target Context                system_u:object_r:svirt_sandbox_file_t:s0:c679,c93
                              6
Target Objects                 [ file ]
Source                        slappasswd
Source Path                   /usr/sbin/slappasswd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.12.1-179.fc20.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.15.8-200.fc20.x86_64 #1 SMP Fri
                              Aug 1 00:38:50 UTC 2014 x86_64 x86_64
Alert Count                   2
First Seen                    2014-08-13 15:28:19 CEST
Last Seen                     2014-08-13 15:28:20 CEST
Local ID                      57ea2025-4574-4d54-8cfe-50b48dfb8479

Raw Audit Messages
type=AVC msg=audit(1407936500.233:514): avc:  denied  { execmod } for  pid=2862 comm="slapadd" path="/usr/sbin/slapadd" dev="dm-4" ino=144223 scontext=system_u:system_r:svirt_lxc_net_t:s0:c679,c936 tcontext=system_u:object_r:svirt_sandbox_file_t:s0:c679,c936 tclass=file


type=SYSCALL msg=audit(1407936500.233:514): arch=x86_64 syscall=mprotect success=no exit=EACCES a0=7fd5b873a000 a1=12a000 a2=5 a3=7fd5b7d55428 items=0 ppid=2831 pid=2862 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=slapadd exe=/usr/sbin/slapadd subj=system_u:system_r:svirt_lxc_net_t:s0:c679,c936 key=(null)

Hash: slappasswd,svirt_lxc_net_t,svirt_sandbox_file_t,file,execmod

Additional info:
reporter:       libreport-2.2.3
hashmarkername: setroubleshoot
kernel:         3.15.8-200.fc20.x86_64
type:           libreport

Comment 1 Daniel Walsh 2014-08-13 15:15:51 UTC
00660273f83ee1cfb19365f761863760ac2ed3c0 fixes this in git.

Comment 2 Lukas Vrabec 2014-08-27 12:29:11 UTC
backported.

commit 00660273f83ee1cfb19365f761863760ac2ed3c0
Author: Dan Walsh <dwalsh@redhat.com>
Date:   Wed Aug 13 11:14:50 2014 -0400

    sandbox domains should be allowed to use libraries which require execmod

https://github.com/selinux-policy/selinux-policy/commit/00660273f83ee1cfb19365f761863760ac2ed3c0

Comment 3 Fedora Update System 2014-08-27 14:52:55 UTC
selinux-policy-3.12.1-182.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/selinux-policy-3.12.1-182.fc20

Comment 4 Fedora Update System 2014-08-28 15:30:46 UTC
Package selinux-policy-3.12.1-182.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing selinux-policy-3.12.1-182.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-9819/selinux-policy-3.12.1-182.fc20
then log in and leave karma (feedback).

Comment 5 Fedora Update System 2014-08-30 03:54:54 UTC
selinux-policy-3.12.1-182.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 6 Hong Xu 2015-03-24 18:05:22 UTC
Can you back port the fix to EL 7? I also have this problem on EL 7. Thanks!

Comment 7 Lukas Vrabec 2015-03-25 00:10:20 UTC
Hong,
Could you create BZ for EL 7? 

Mirek,
Please check this issue.

Comment 8 Hong Xu 2015-03-26 20:02:30 UTC
OK, new ticket created as #1206339

Comment 9 Lukas Vrabec 2015-03-27 10:05:21 UTC
Thank you.


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