Bug 1004705 - SELinux is preventing /usr/sbin/useradd from 'write' accesses on the file /dev/null.
SELinux is preventing /usr/sbin/useradd from 'write' accesses on the file /de...
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: livecd-tools (Show other bugs)
20
x86_64 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Brian Lane
Fedora Extras Quality Assurance
abrt_hash:1fd377e4c768db22fb85d65482e...
:
: 1004706 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-05 05:52 EDT by Igor Gnatenko
Modified: 2014-01-14 14:18 EST (History)
11 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-01-14 14:18:53 EST
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 Igor Gnatenko 2013-09-05 05:52:12 EDT
Description of problem:
SELinux is preventing /usr/sbin/useradd from 'write' accesses on the file /dev/null.

*****  Plugin leaks (86.2 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 (14.7 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                          (removed)
Source RPM Packages           shadow-utils-4.1.5.1-8.fc20.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.12.1-75.fc20.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 3.11.0-3.fc20.x86_64 #1 SMP Tue
                              Sep 3 21:52:28 UTC 2013 x86_64 x86_64
Alert Count                   4
First Seen                    2013-09-05 13:50:53 MSK
Last Seen                     2013-09-05 13:51:23 MSK
Local ID                      37be374f-05af-42d0-850b-84af99029b5d

Raw Audit Messages
type=AVC msg=audit(1378374683.421:907): avc:  denied  { write } for  pid=13760 comm="useradd" path="/dev/null" dev="sda2" ino=3943313 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(1378374683.421:907): arch=x86_64 syscall=execve success=yes exit=0 a0=16c3d00 a1=16c2a60 a2=16c0340 a3=7ffffb925020 items=0 ppid=13753 pid=13760 auid=1000 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=5 tty=pts0 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

Additional info:
reporter:       libreport-2.1.6
hashmarkername: setroubleshoot
kernel:         3.11.0-3.fc20.x86_64
type:           libreport

Potential duplicate: bug 861281
Comment 1 Igor Gnatenko 2013-09-05 05:53:12 EDT
$ sudo livecd-iso-to-disk --format --efi Fedora-19-x86_64-netinst.iso /dev/sdb
Comment 2 Daniel Walsh 2013-09-05 09:19:01 EDT
Why is livecd-iso-to-disk executing useradd?  And why is /dev/null mislabeled?
Comment 3 Brian Lane 2013-09-05 19:40:41 EDT
I have no idea. litd doesn't call useradd directly and I can't think of any reason for the format or efi paths to be using it indirectly.

Is it possible for the reporter to try and debug this a bit more?
Comment 4 Igor Gnatenko 2013-09-06 00:33:24 EDT
(In reply to Brian C. Lane from comment #3)
> I have no idea. litd doesn't call useradd directly and I can't think of any
> reason for the format or efi paths to be using it indirectly.
> 
> Is it possible for the reporter to try and debug this a bit more?
Sure. Let me discover what I should to do.
Comment 5 Lukas Vrabec 2013-10-11 07:03:30 EDT
*** Bug 1004706 has been marked as a duplicate of this bug. ***
Comment 6 Brian Lane 2014-01-14 14:18:53 EST
This is working fine for me on F20 with the host in Enforcing mode (see bug 1051523)

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