Bug 1600913 - buildah run doesn't work if selinux is enforcing
Summary: buildah run doesn't work if selinux is enforcing
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: buildah
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lokesh Mandvekar
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-07-13 11:15 UTC by Alessio
Modified: 2018-07-25 18:44 UTC (History)
6 users (show)

Fixed In Version: buildah-1.2-1.gitbe87762.fc28 buildah-1.2-1.gitbe87762.fc27
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-07-24 17:29:15 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Alessio 2018-07-13 11:15:08 UTC
Description of problem:

buildah run doesn't seem to work (without any output) if selinux is in enforcing state

If setenforce 0 is issued, then buildah run works.

Version-Release number of selected component (if applicable):

buildah-1.0-3.gitfe204e4.fc29.x86_64

libselinux-utils-2.8-2.fc29.x86_64
libselinux-2.8-2.fc29.x86_64
selinux-policy-targeted-3.14.2-26.fc29.noarch
container-selinux-2.67-2.git042f7cf.fc29.noarch
rpm-plugin-selinux-4.14.2-0.rc1.1.fc29.1.x86_64
selinux-policy-3.14.2-26.fc29.noarch
python3-libselinux-2.8-2.fc29.x86_64

kernel-4.18.0-0.rc4.git0.1.fc29.x86_64

Comment 1 Daniel Walsh 2018-07-13 11:49:59 UTC
Please attach AVC messages.


You might want to run 

yum reinstall container-selinux
restorecon -R -v /var/lib/containers

If labeling got screwed up in these directories.

Comment 2 Alessio 2018-07-13 12:48:11 UTC
This is from /var/log/messages when I issue "buildah run fedora-working-container bash"

Jul 13 14:46:53 localhost kernel: SELinux: mount invalid.  Same superblock, different security settings for (dev mqueue, type mqueue)
Jul 13 14:46:53 localhost audit[8761]: AVC avc:  denied  { read write } for  pid=8761 comm="bash" path="/dev/pts/0" dev="devpts" ino=3 scontext=system_u:system_r:container_t:s0:c285,c480 tcontext=system_u:object_r:container_file_t:s0:c285,c480 tclass=chr_file permissive=0
Jul 13 14:46:53 localhost audit[8761]: AVC avc:  denied  { read write } for  pid=8761 comm="bash" path="/dev/pts/0" dev="devpts" ino=3 scontext=system_u:system_r:container_t:s0:c285,c480 tcontext=system_u:object_r:container_file_t:s0:c285,c480 tclass=chr_file permissive=0
Jul 13 14:46:53 localhost audit[8761]: AVC avc:  denied  { read write } for  pid=8761 comm="bash" path="/dev/pts/0" dev="devpts" ino=3 scontext=system_u:system_r:container_t:s0:c285,c480 tcontext=system_u:object_r:container_file_t:s0:c285,c480 tclass=chr_file permissive=0
Jul 13 14:46:53 localhost audit[8761]: AVC avc:  denied  { read write } for  pid=8761 comm="bash" path="/dev/pts/0" dev="devpts" ino=3 scontext=system_u:system_r:container_t:s0:c285,c480 tcontext=system_u:object_r:container_file_t:s0:c285,c480 tclass=chr_file permissive=0
Jul 13 14:46:53 localhost audit[8761]: AVC avc:  denied  { map } for  pid=8761 comm="bash" path="/usr/bin/bash" dev="dm-0" ino=1299039 scontext=system_u:system_r:container_t:s0:c285,c480 tcontext=unconfined_u:object_r:var_lib_t:s0 tclass=file permissive=0
Jul 13 14:46:53 localhost audit[8761]: ANOM_ABEND auid=1000 uid=0 gid=0 ses=1 subj=system_u:system_r:container_t:s0:c285,c480 pid=8761 comm="bash" exe="/usr/bin/bash" sig=11 res=1

Comment 3 Daniel Walsh 2018-07-13 12:52:05 UTC
Did container-selinux install correctly?


yum reinstall container-selinux

grep expand-check /etc/selinux/semanage.conf

This field should be
expand-check=0

Comment 4 Alessio 2018-07-13 13:55:17 UTC
(In reply to Daniel Walsh from comment #3)
> Did container-selinux install correctly?
> 
> 
> yum reinstall container-selinux
> 
> grep expand-check /etc/selinux/semanage.conf
> 
> This field should be
> expand-check=0

...
Reinstalled:
  container-selinux-2:2.67-2.git042f7cf.fc29.noarch                                                                                                                                                    

Complete!
[root@alessiopc alessio]# grep expand-check /etc/selinux/semanage.conf
# expand-check check neverallow rules when executing all semanage
expand-check = 1

Comment 5 Daniel Walsh 2018-07-13 15:03:51 UTC
Change the expand-check to = 0

Comment 6 Daniel Walsh 2018-07-13 15:04:44 UTC
What is the buildah command you are running?

Comment 7 Fedora Update System 2018-07-15 12:57:07 UTC
buildah-1.2-1.gitbe87762.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-d9a8457274

Comment 8 Fedora Update System 2018-07-15 12:57:33 UTC
buildah-1.2-1.gitbe87762.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-0eb77f53f4

Comment 9 Fedora Update System 2018-07-16 18:05:02 UTC
buildah-1.2-1.gitbe87762.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-0eb77f53f4

Comment 10 Fedora Update System 2018-07-16 20:29:09 UTC
buildah-1.2-1.gitbe87762.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-d9a8457274

Comment 11 Alessio 2018-07-17 07:44:38 UTC
(In reply to Daniel Walsh from comment #6)
> What is the buildah command you are running?

This one, for instance

buildah run fedora-working-container /bin/bash

Comment 12 Alessio 2018-07-17 07:49:34 UTC
(In reply to Daniel Walsh from comment #5)
> Change the expand-check to = 0

Even with this option, the issue remains

Comment 13 Daniel Walsh 2018-07-17 12:13:25 UTC
Alessio, can we communicate on IRC.  I think this is a configuration issue.  Since no one else is reporting problems.

I am dwalsh on #buildah on freenode.

Comment 14 Fedora Update System 2018-07-24 17:29:15 UTC
buildah-1.2-1.gitbe87762.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.

Comment 15 Fedora Update System 2018-07-25 18:44:21 UTC
buildah-1.2-1.gitbe87762.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.


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