RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 869176 - Blocking and dontauditing write to user_tmp while append is allowed is confusing
Summary: Blocking and dontauditing write to user_tmp while append is allowed is confusing
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: selinux-policy
Version: 6.4
Hardware: All
OS: Linux
unspecified
low
Target Milestone: rc
: ---
Assignee: Miroslav Grepl
QA Contact: Michal Trunecka
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-10-23 08:13 UTC by Michal Trunecka
Modified: 2014-09-30 23:33 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-10-23 12:22:57 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Michal Trunecka 2012-10-23 08:13:02 UTC
Description of problem:

This does not work (tempfile is created, but nothing is written in it):
restorecon /path/which/doesnt/exist 2> /tmp/tempfile
But this works fine (tempfile contains warning message):
restorecon /path/which/doesnt/exist 2>> /tmp/tempfile

This is caused by selinux, but no AVC messages are audited even in permissive mode, only when dontaudit rules are disabled (semodule -DB) is audited following AVC:

time->Tue Oct 23 10:08:47 2012
type=PATH msg=audit(1350979727.032:244): item=1 name=(null) inode=2946 dev=fd:00 mode=0100755 ouid=0 ogid=0 rdev=00:00 obj=system_u:object_r:ld_so_t:s0
type=PATH msg=audit(1350979727.032:244): item=0 name="/sbin/restorecon" inode=133853 dev=fd:00 mode=0100755 ouid=0 ogid=0 rdev=00:00 obj=system_u:object_r:setfiles_exec_t:s0
type=CWD msg=audit(1350979727.032:244):  cwd="/root/policycoreutils/Regression/bz824779-restorecon-does-not-return-proper-exit-codes-on"
type=EXECVE msg=audit(1350979727.032:244): argc=2 a0="restorecon" a1="/tmp/dir/that/does/not/exists"
type=SYSCALL msg=audit(1350979727.032:244): arch=c000003e syscall=59 success=yes exit=0 a0=159a9c0 a1=159c300 a2=14d48f0 a3=7fff355a00a0 items=2 ppid=3537 pid=3652 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts0 ses=1 comm="restorecon" exe="/sbin/setfiles" subj=unconfined_u:unconfined_r:setfiles_t:s0-s0:c0.c1023 key=(null)
type=AVC msg=audit(1350979727.032:244): avc:  denied  { write } for  pid=3652 comm="restorecon" path="/tmp/tmp.Zms0Z5VRD2" dev=dm-0 ino=6546 scontext=unconfined_u:unconfined_r:setfiles_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_tmp_t:s0 tclass=file



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


How reproducible:
always

  
Actual results:
denied and dontaudited write while append is allowed

Expected results:
Allowed write or audited denial

Additional info:

Comment 1 Miroslav Grepl 2012-10-23 12:22:57 UTC
This is correct. We don't want to allow write. But some apps need "append" and this is a reason why we allow it. You "just" do "append".


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