Bug 807952 - SELinux is preventing /usr/sbin/useradd from 'write' accesses on the file group.
Summary: SELinux is preventing /usr/sbin/useradd from 'write' accesses on the file group.
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 19
Hardware: i686
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:f18d5eb70c0d7406c245ffd88c7...
: 769972 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-03-29 08:28 UTC by Kamil Páral
Modified: 2015-02-17 14:11 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-02-17 14:11:04 UTC
Type: ---


Attachments (Terms of Use)

Description Kamil Páral 2012-03-29 08:28:15 UTC
libreport version: 2.0.8
executable:     /usr/bin/python
hashmarkername: setroubleshoot
kernel:         3.3.0-1.fc17.i686.PAE
reason:         SELinux is preventing /usr/sbin/useradd from 'write' accesses on the file group.
time:           Wed 28 Mar 2012 10:21:58 AM EDT

description:
:SELinux is preventing /usr/sbin/useradd from 'write' accesses on the file group.
:
:*****  Plugin catchall_labels (83.8 confidence) suggests  ********************
:
:If you want to allow useradd to have write access on the group file
:Then you need to change the label on group
:Do
:# semanage fcontext -a -t FILE_TYPE 'group'
:where FILE_TYPE is one of the following: passwd_file_t, security_t, faillog_t, lastlog_t, puppet_tmp_t, useradd_t, user_home_type, initrc_var_run_t, semanage_tmp_t, semanage_read_lock_t, pcscd_var_run_t, afs_cache_t, file_context_t, selinux_config_t, puppet_tmp_t, default_context_t, httpd_user_content_type, mail_spool_t, shadow_t, semanage_trans_lock_t, semanage_store_t, user_cron_spool_t, httpd_user_script_exec_type. 
:Then execute: 
:restorecon -v 'group'
:
:
:*****  Plugin catchall (17.1 confidence) suggests  ***************************
:
:If you believe that useradd should be allowed write access on the group file by default.
:Then you should report this as a bug.
:You can generate a local policy module to allow this access.
:Do
:allow this access for now by executing:
:# grep useradd /var/log/audit/audit.log | audit2allow -M mypol
:# semodule -i mypol.pp
:
:Additional Information:
:Source Context                unconfined_u:unconfined_r:useradd_t:s0-s0:c0.c1023
:Target Context                unconfined_u:object_r:etc_t:s0
:Target Objects                group [ file ]
:Source                        useradd
:Source Path                   /usr/sbin/useradd
:Port                          <Unknown>
:Host                          (removed)
:Source RPM Packages           shadow-utils-4.1.4.3-14.fc17.i686
:Target RPM Packages           
:Policy RPM                    selinux-policy-3.10.0-106.fc17.noarch
:Selinux Enabled               True
:Policy Type                   targeted
:Enforcing Mode                Enforcing
:Host Name                     (removed)
:Platform                      Linux (removed)
:                              3.3.0-1.fc17.i686.PAE #1 SMP Mon Mar 19 03:11:34
:                              UTC 2012 i686 i686
:Alert Count                   2
:First Seen                    Wed 28 Mar 2012 10:20:01 AM EDT
:Last Seen                     Wed 28 Mar 2012 10:21:05 AM EDT
:Local ID                      c558782c-08b9-4769-927d-b92ae18c8ace
:
:Raw Audit Messages
:type=AVC msg=audit(1332944465.877:94): avc:  denied  { write } for  pid=1916 comm="useradd" name="group" dev="dm-1" ino=135947 scontext=unconfined_u:unconfined_r:useradd_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:etc_t:s0 tclass=file
:
:
:type=SYSCALL msg=audit(1332944465.877:94): arch=i386 syscall=open success=no exit=EACCES a0=b77df460 a1=8002 a2=1b6 a3=b784e5c0 items=0 ppid=1911 pid=1916 auid=1000 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts0 ses=2 comm=useradd exe=/usr/sbin/useradd subj=unconfined_u:unconfined_r:useradd_t:s0-s0:c0.c1023 key=(null)
:
:Hash: useradd,useradd_t,etc_t,file,write
:
:audit2allowunable to open /sys/fs/selinux/policy:  Permission denied
:
:
:audit2allow -Runable to open /sys/fs/selinux/policy:  Permission denied
:
:

Comment 1 Kamil Páral 2012-03-29 08:30:01 UTC
I was running lorax and creating a new boot.iso.

There were more errors regarding 'useradd', I'll post it here if I figure out how.

Comment 2 Kamil Páral 2012-03-29 08:30:43 UTC
SELinux is preventing /usr/sbin/useradd from read access on the lnk_file run.

*****  Plugin catchall_labels (83.8 confidence) suggests  ********************

If you want to allow useradd to have read access on the run lnk_file
Then you need to change the label on run
Do
# semanage fcontext -a -t FILE_TYPE 'run'
where FILE_TYPE is one of the following: cert_t, etc_t, var_run_t, useradd_t, user_home_type, domain, device_t, abrt_t, etc_runtime_t, lib_t, root_t, ld_so_t, proc_t, home_root_t, textrel_shlib_t, selinux_config_t, rpm_script_tmp_t, user_home_dir_t, var_run_t, var_run_t, httpd_user_content_type, mail_spool_t, device_t, devlog_t, bin_t, cert_t, locale_t, etc_t, proc_t, usr_t, var_run_t, httpd_user_script_exec_type, var_run_t, var_run_t. 
Then execute: 
restorecon -v 'run'


*****  Plugin catchall (17.1 confidence) suggests  ***************************

If you believe that useradd should be allowed read access on the run lnk_file by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# grep useradd /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                unconfined_u:unconfined_r:useradd_t:s0-s0:c0.c1023
Target Context                unconfined_u:object_r:var_t:s0
Target Objects                run [ lnk_file ]
Source                        useradd
Source Path                   /usr/sbin/useradd
Port                          <Unknown>
Host                          dhcp-29-197.brq.redhat.com
Source RPM Packages           shadow-utils-4.1.4.3-14.fc17.i686
Target RPM Packages           filesystem-3-2.fc17.i686
Policy RPM                    selinux-policy-3.10.0-106.fc17.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     dhcp-29-197.brq.redhat.com
Platform                      Linux dhcp-29-197.brq.redhat.com
                              3.3.0-1.fc17.i686.PAE #1 SMP Mon Mar 19 03:11:34
                              UTC 2012 i686 i686
Alert Count                   14
First Seen                    Wed 28 Mar 2012 10:20:01 AM EDT
Last Seen                     Wed 28 Mar 2012 10:22:35 AM EDT
Local ID                      7642db47-409d-47e4-ae8e-6fa41ed415e7

Raw Audit Messages
type=AVC msg=audit(1332944555.866:116): avc:  denied  { read } for  pid=2168 comm="useradd" name="run" dev="dm-1" ino=132863 scontext=unconfined_u:unconfined_r:useradd_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:var_t:s0 tclass=lnk_file


type=SYSCALL msg=audit(1332944555.866:116): arch=i386 syscall=socketcall success=no exit=EACCES a0=3 a1=bfbe90a0 a2=b764fff4 a3=4 items=0 ppid=2161 pid=2168 auid=1000 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts0 ses=2 comm=useradd exe=/usr/sbin/useradd subj=unconfined_u:unconfined_r:useradd_t:s0-s0:c0.c1023 key=(null)

Hash: useradd,useradd_t,var_t,lnk_file,read

audit2allowunable to open /sys/fs/selinux/policy:  Permission denied


audit2allow -Runable to open /sys/fs/selinux/policy:  Permission denied

Comment 3 Kamil Páral 2012-03-29 08:31:01 UTC
SELinux is preventing /usr/sbin/useradd from write access on the file /dev/null.

*****  Plugin leaks (50.5 confidence) suggests  ******************************

If you want to ignore useradd trying to write access the null file, because you believe it should not need this access.
Then you should report this as a bug.  
You can generate a local policy module to dontaudit this access.
Do
# grep /usr/sbin/useradd /var/log/audit/audit.log | audit2allow -D -M mypol
# semodule -i mypol.pp

*****  Plugin catchall (50.5 confidence) suggests  ***************************

If you believe that useradd should be allowed write access on the null file by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# grep useradd /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                unconfined_u:unconfined_r:useradd_t:s0-s0:c0.c1023
Target Context                unconfined_u:object_r:device_t:s0
Target Objects                /dev/null [ file ]
Source                        useradd
Source Path                   /usr/sbin/useradd
Port                          <Unknown>
Host                          dhcp-29-197.brq.redhat.com
Source RPM Packages           shadow-utils-4.1.4.3-14.fc17.i686
Target RPM Packages           
Policy RPM                    selinux-policy-3.10.0-106.fc17.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     dhcp-29-197.brq.redhat.com
Platform                      Linux dhcp-29-197.brq.redhat.com
                              3.3.0-1.fc17.i686.PAE #1 SMP Mon Mar 19 03:11:34
                              UTC 2012 i686 i686
Alert Count                   2
First Seen                    Wed 28 Mar 2012 10:21:05 AM EDT
Last Seen                     Wed 28 Mar 2012 10:22:28 AM EDT
Local ID                      553e1562-3e42-4f01-bb9a-4c9d5972f810

Raw Audit Messages
type=AVC msg=audit(1332944548.385:103): avc:  denied  { write } for  pid=2082 comm="useradd" path="/dev/null" dev="dm-1" ino=133202 scontext=unconfined_u:unconfined_r:useradd_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:device_t:s0 tclass=file


type=AVC msg=audit(1332944548.385:103): avc:  denied  { write } for  pid=2082 comm="useradd" path="/dev/null" dev="dm-1" ino=133202 scontext=unconfined_u:unconfined_r:useradd_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:device_t:s0 tclass=file


type=SYSCALL msg=audit(1332944548.385:103): arch=i386 syscall=execve success=yes exit=0 a0=8e69c00 a1=8e67ef8 a2=8e67c58 a3=8e67ef8 items=0 ppid=2074 pid=2082 auid=1000 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts0 ses=2 comm=useradd exe=/usr/sbin/useradd subj=unconfined_u:unconfined_r:useradd_t:s0-s0:c0.c1023 key=(null)

Hash: useradd,useradd_t,device_t,file,write

audit2allowunable to open /sys/fs/selinux/policy:  Permission denied


audit2allow -Runable to open /sys/fs/selinux/policy:  Permission denied

Comment 4 Kamil Páral 2012-03-29 08:31:21 UTC
SELinux is preventing /usr/sbin/setfiles from write access on the file /dev/null.

*****  Plugin leaks (50.5 confidence) suggests  ******************************

If you want to ignore setfiles trying to write access the null file, because you believe it should not need this access.
Then you should report this as a bug.  
You can generate a local policy module to dontaudit this access.
Do
# grep /usr/sbin/setfiles /var/log/audit/audit.log | audit2allow -D -M mypol
# semodule -i mypol.pp

*****  Plugin catchall (50.5 confidence) suggests  ***************************

If you believe that setfiles should be allowed write access on the null file by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# grep restorecon /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                unconfined_u:unconfined_r:setfiles_t:s0-s0:c0.c102
                              3
Target Context                unconfined_u:object_r:device_t:s0
Target Objects                /dev/null [ file ]
Source                        restorecon
Source Path                   /usr/sbin/setfiles
Port                          <Unknown>
Host                          dhcp-29-197.brq.redhat.com
Source RPM Packages           policycoreutils-2.1.10-29.fc17.i686
Target RPM Packages           
Policy RPM                    selinux-policy-3.10.0-106.fc17.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     dhcp-29-197.brq.redhat.com
Platform                      Linux dhcp-29-197.brq.redhat.com
                              3.3.0-1.fc17.i686.PAE #1 SMP Mon Mar 19 03:11:34
                              UTC 2012 i686 i686
Alert Count                   2
First Seen                    Wed 28 Mar 2012 10:21:26 AM EDT
Last Seen                     Wed 28 Mar 2012 10:23:10 AM EDT
Local ID                      68a97573-7d13-4409-b340-132b7d227324

Raw Audit Messages
type=AVC msg=audit(1332944590.925:119): avc:  denied  { write } for  pid=2262 comm="restorecon" path="/dev/null" dev="dm-1" ino=133202 scontext=unconfined_u:unconfined_r:setfiles_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:device_t:s0 tclass=file


type=SYSCALL msg=audit(1332944590.925:119): arch=i386 syscall=execve success=yes exit=0 a0=9a7a8b8 a1=9a7abb0 a2=9a7ac58 a3=9a7abb0 items=0 ppid=2260 pid=2262 auid=1000 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts0 ses=2 comm=restorecon exe=/usr/sbin/setfiles subj=unconfined_u:unconfined_r:setfiles_t:s0-s0:c0.c1023 key=(null)

Hash: restorecon,setfiles_t,device_t,file,write

audit2allowunable to open /sys/fs/selinux/policy:  Permission denied


audit2allow -Runable to open /sys/fs/selinux/policy:  Permission denied

Comment 5 Miroslav Grepl 2012-03-29 08:43:53 UTC
The machine is totally mislabeled. Do you have reproducer?

Comment 6 Kamil Páral 2012-03-29 11:30:49 UTC
I executed this command:

root@machine:~/tmp$ lorax -p fedora -v 123 -r abc -s http://download.englab.brq.redhat.com/pub/fedora/linux/development/17/i386/os/ out

Comment 7 Miroslav Grepl 2012-03-29 11:31:07 UTC
Well I would say this is a problem which we had/have with pungi. We ignore errors which relate with this tool. 

Not sure about lorax, I don't know it .. I will need to look at it.

Comment 8 Miroslav Grepl 2012-04-13 09:14:20 UTC
*** Bug 769972 has been marked as a duplicate of this bug. ***

Comment 9 Fedora End Of Life 2013-04-03 16:18:15 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle.
Changing version to '19'.

(As we did not run this process for some time, it could affect also pre-Fedora 19 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19

Comment 10 Fedora End Of Life 2015-01-09 17:05:06 UTC
This message is a notice that Fedora 19 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 19. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 19 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 11 Fedora End Of Life 2015-02-17 14:11:04 UTC
Fedora 19 changed to end-of-life (EOL) status on 2015-01-06. Fedora 19 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


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