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 1253632 - pam_timestamp cannot create timestamp file
Summary: pam_timestamp cannot create timestamp file
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: selinux-policy
Version: 7.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Miroslav Grepl
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-08-14 10:54 UTC by Dalibor Pospíšil
Modified: 2015-12-18 09:51 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 1253619
Environment:
Last Closed: 2015-12-18 09:51:03 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Dalibor Pospíšil 2015-08-14 10:54:11 UTC
+++ This bug was initially created as a clone of Bug #1253619 +++

Description of problem:
pam_timestamp uses /var/run/sudo/user/ to store data. If the directory does not exist it tries to create it which fail. 

----
time->Fri Aug 14 12:51:13 2015
type=SYSCALL msg=audit(1439549473.414:4120): arch=c000003e syscall=2 success=yes exit=5 a0=7ff9b86bc4c0 a1=0 a2=7ffda73f0f38 a3=4000 items=0 ppid=21646 pid=21790 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=542 comm="sshd" exe="/usr/sbin/sshd" subj=system_u:system_r:sshd_t:s0-s0:c0.c1023 key=(null)
type=AVC msg=audit(1439549473.414:4120): avc:  denied  { open } for  pid=21790 comm="sshd" path="/run/sudo/_pam_timestamp_key" dev="tmpfs" ino=218920 scontext=system_u:system_r:sshd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:crond_var_run_t:s0 tclass=file
type=AVC msg=audit(1439549473.414:4120): avc:  denied  { read } for  pid=21790 comm="sshd" name="_pam_timestamp_key" dev="tmpfs" ino=218920 scontext=system_u:system_r:sshd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:crond_var_run_t:s0 tclass=file
----
time->Fri Aug 14 12:51:13 2015
type=SYSCALL msg=audit(1439549473.414:4121): arch=c000003e syscall=5 success=yes exit=0 a0=5 a1=7ffda73f0e30 a2=7ffda73f0e30 a3=4000 items=0 ppid=21646 pid=21790 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=542 comm="sshd" exe="/usr/sbin/sshd" subj=system_u:system_r:sshd_t:s0-s0:c0.c1023 key=(null)
type=AVC msg=audit(1439549473.414:4121): avc:  denied  { getattr } for  pid=21790 comm="sshd" path="/run/sudo/_pam_timestamp_key" dev="tmpfs" ino=218920 scontext=system_u:system_r:sshd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:crond_var_run_t:s0 tclass=file
----
time->Fri Aug 14 12:51:14 2015
type=SYSCALL msg=audit(1439549474.734:4142): arch=c000003e syscall=2 success=yes exit=10 a0=7f96853bb4c0 a1=0 a2=7ffd2b66fc50 a3=4000 items=0 ppid=21899 pid=21901 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="sshd" exe="/usr/sbin/sshd" subj=system_u:system_r:sshd_t:s0-s0:c0.c1023 key=(null)
type=AVC msg=audit(1439549474.734:4142): avc:  denied  { open } for  pid=21901 comm="sshd" path="/run/sudo/_pam_timestamp_key" dev="tmpfs" ino=218920 scontext=system_u:system_r:sshd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:crond_var_run_t:s0 tclass=file
type=AVC msg=audit(1439549474.734:4142): avc:  denied  { read } for  pid=21901 comm="sshd" name="_pam_timestamp_key" dev="tmpfs" ino=218920 scontext=system_u:system_r:sshd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:crond_var_run_t:s0 tclass=file
----
time->Fri Aug 14 12:51:14 2015
type=SYSCALL msg=audit(1439549474.734:4143): arch=c000003e syscall=5 success=yes exit=0 a0=a a1=7ffd2b66fb10 a2=7ffd2b66fb10 a3=4000 items=0 ppid=21899 pid=21901 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="sshd" exe="/usr/sbin/sshd" subj=system_u:system_r:sshd_t:s0-s0:c0.c1023 key=(null)
type=AVC msg=audit(1439549474.734:4143): avc:  denied  { getattr } for  pid=21901 comm="sshd" path="/run/sudo/_pam_timestamp_key" dev="tmpfs" ino=218920 scontext=system_u:system_r:sshd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:crond_var_run_t:s0 tclass=file
----
time->Fri Aug 14 12:51:14 2015
type=SYSCALL msg=audit(1439549474.881:4151): arch=c000003e syscall=2 success=yes exit=5 a0=7f96853bb4c0 a1=0 a2=7ffd2b670028 a3=4000 items=0 ppid=21646 pid=21899 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=543 comm="sshd" exe="/usr/sbin/sshd" subj=system_u:system_r:sshd_t:s0-s0:c0.c1023 key=(null)
type=AVC msg=audit(1439549474.881:4151): avc:  denied  { open } for  pid=21899 comm="sshd" path="/run/sudo/_pam_timestamp_key" dev="tmpfs" ino=218920 scontext=system_u:system_r:sshd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:crond_var_run_t:s0 tclass=file
type=AVC msg=audit(1439549474.881:4151): avc:  denied  { read } for  pid=21899 comm="sshd" name="_pam_timestamp_key" dev="tmpfs" ino=218920 scontext=system_u:system_r:sshd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:crond_var_run_t:s0 tclass=file
----
time->Fri Aug 14 12:51:14 2015
type=SYSCALL msg=audit(1439549474.881:4152): arch=c000003e syscall=5 success=yes exit=0 a0=5 a1=7ffd2b66ff20 a2=7ffd2b66ff20 a3=4000 items=0 ppid=21646 pid=21899 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=543 comm="sshd" exe="/usr/sbin/sshd" subj=system_u:system_r:sshd_t:s0-s0:c0.c1023 key=(null)
type=AVC msg=audit(1439549474.881:4152): avc:  denied  { getattr } for  pid=21899 comm="sshd" path="/run/sudo/_pam_timestamp_key" dev="tmpfs" ino=218920 scontext=system_u:system_r:sshd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:crond_var_run_t:s0 tclass=file

Version-Release number of selected component (if applicable):
selinux-policy-3.13.1-40.el7.noarch
kernel-3.10.0-304.el7.x86_64

How reproducible:
always

Steps to Reproduce:
1. see liked test

Comment 1 Miroslav Grepl 2015-08-17 08:54:41 UTC
Well the problem is you have bad labeling.

#ls -dZ /run/sudo

vs.

#matchpathcon /run/sudo

So is it created by cron?

Comment 3 Dalibor Pospíšil 2015-08-27 18:28:08 UTC
I do not know why the file is created with that context. The test itself does not touch that file. I will do some more investigation on it.


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