Bug 1250912 - SELinux is preventing /bin/bash from read, write access on the chr_file /dev/pts/2.
SELinux is preventing /bin/bash from read, write access on the chr_file /dev/...
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
22
x86_64 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Miroslav Grepl
Fedora Extras Quality Assurance
abrt_hash:cdff8a5cccd29fd7e5bde10d18a...
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-06 05:44 EDT by Yajo
Modified: 2015-08-07 05:54 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-08-07 05:54:47 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 Yajo 2015-08-06 05:44:24 EDT
Description of problem:
Using `docker exec` to run a command in a started container.
SELinux is preventing /bin/bash from read, write access on the chr_file /dev/pts/2.

*****  Plugin leaks (86.2 confidence) suggests   *****************************

If quiere ignorar bash intentando que read write acceda al 2 chr_file, debido a que considera que no debería necesitar este acceso.
Then debería reportar esto como un error.
Puede generar un módulo de política local para no auditar este acceso.
Do
# grep /bin/bash /var/log/audit/audit.log | audit2allow -D -M mypol
# semodule -i mypol.pp

*****  Plugin catchall (14.7 confidence) suggests   **************************

If cree que de manera predeterminada, bash debería permitir acceso read write sobre  2 chr_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 update-sass /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:c529,c548
Target Context                system_u:object_r:docker_devpts_t:s0
Target Objects                /dev/pts/2 [ chr_file ]
Source                        update-sass
Source Path                   /bin/bash
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           bash-4.3.39-6.fc22.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-128.8.fc22.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.1.3-201.fc22.x86_64 #1 SMP Wed
                              Jul 29 19:50:22 UTC 2015 x86_64 x86_64
Alert Count                   1
First Seen                    2015-08-06 11:43:24 CEST
Last Seen                     2015-08-06 11:43:24 CEST
Local ID                      a97d3320-6812-4e5a-add8-63b83362b501

Raw Audit Messages
type=AVC msg=audit(1438854204.956:627): avc:  denied  { read write } for  pid=9656 comm="update-sass" path="/dev/pts/2" dev="devpts" ino=5 scontext=system_u:system_r:svirt_lxc_net_t:s0:c529,c548 tcontext=system_u:object_r:docker_devpts_t:s0 tclass=chr_file permissive=0


type=AVC msg=audit(1438854204.956:627): avc:  denied  { read write } for  pid=9656 comm="update-sass" path="/dev/pts/2" dev="devpts" ino=5 scontext=system_u:system_r:svirt_lxc_net_t:s0:c529,c548 tcontext=system_u:object_r:docker_devpts_t:s0 tclass=chr_file permissive=0


type=AVC msg=audit(1438854204.956:627): avc:  denied  { read write } for  pid=9656 comm="update-sass" path="/dev/pts/2" dev="devpts" ino=5 scontext=system_u:system_r:svirt_lxc_net_t:s0:c529,c548 tcontext=system_u:object_r:docker_devpts_t:s0 tclass=chr_file permissive=0


type=AVC msg=audit(1438854204.956:627): avc:  denied  { read write } for  pid=9656 comm="update-sass" path="/dev/pts/2" dev="devpts" ino=5 scontext=system_u:system_r:svirt_lxc_net_t:s0:c529,c548 tcontext=system_u:object_r:docker_devpts_t:s0 tclass=chr_file permissive=0


type=SYSCALL msg=audit(1438854204.956:627): arch=x86_64 syscall=execve success=yes exit=0 a0=c208094260 a1=c2080ade40 a2=c208053c80 a3=0 items=0 ppid=922 pid=9656 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=update-sass exe=/bin/bash subj=system_u:system_r:svirt_lxc_net_t:s0:c529,c548 key=(null)

Hash: update-sass,svirt_lxc_net_t,docker_devpts_t,chr_file,read,write

Version-Release number of selected component:
selinux-policy-3.13.1-128.8.fc22.noarch

Additional info:
reporter:       libreport-2.6.2
hashmarkername: setroubleshoot
kernel:         4.1.3-201.fc22.x86_64
type:           libreport
Comment 1 Yajo 2015-08-06 05:46:32 EDT
$ rpm -qa '*docker-*'
docker-selinux-1.7.1-7.gitd5a81b3.fc22.x86_64
python-docker-py-1.1.0-2.fc22.noarch
docker-fish-completion-1.7.1-7.gitd5a81b3.fc22.x86_64
Comment 2 Yajo 2015-08-06 05:47:10 EDT
Same bug when running with sudo.
Comment 3 Daniel Walsh 2015-08-06 08:58:55 EDT
sesearch -A -s svirt_lxc_net_t -t docker_devpts_t -C
Found 1 semantic av rules:
   allow svirt_sandbox_domain docker_devpts_t : chr_file { ioctl read write getattr lock append open } ; 


Did something go wrong when loading docker-selinux?

dnf reinstall docker-selinux
Comment 4 Yajo 2015-08-07 03:14:37 EDT
(In reply to Daniel Walsh from comment #3)
> dnf reinstall docker-selinux

It seems to have fixed it.

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