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 1989858 - at is not able to schedule jobs for a user which is mapped to selinux confined user - "user_u"
Summary: at is not able to schedule jobs for a user which is mapped to selinux confine...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: at
Version: 7.9
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Jan Staněk
QA Contact: Jan Houska
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-08-04 08:35 UTC by Ameya Patil
Modified: 2022-05-18 16:15 UTC (History)
6 users (show)

Fixed In Version: at-3.1.13-25.el7_9
Doc Type: Bug Fix
Doc Text:
The RHEL 7 version of at contained an older version of selinux-enablement patch, which contained this bug. It was replaced with a version included in more recent upstream releases, bringing the selinux support to par with RHEL 8 and 9.
Clone Of:
Environment:
Last Closed: 2022-05-18 16:15:12 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-92247 0 None None None 2021-08-04 08:39:05 UTC
Red Hat Product Errata RHBA-2022:4638 0 None None None 2022-05-18 16:15:14 UTC

Description Ameya Patil 2021-08-04 08:35:14 UTC
Description of problem:

On RHEL 7 , When a confined user mapped to selinux user "user_u" , tries to execute a job with 'at' command. We get the following errors -

 "Not allowed to set exec context to user_u:user_r:user_t:s0 for user  test#012: Success"

Note that there are no selinux AVC for this.

# ausearch -m AVC -i
<no matches>


Version-Release number of selected component (if applicable):
at-3.1.13-24.el7.x86_64
selinux-policy-3.13.1-268.el7_9.2.noarch
selinux-policy-targeted-3.13.1-268.el7_9.2.noarch


How reproducible:
100%

Steps to Reproduce:
1. Add a confined user mapped with user_u

# useradd -Z user_u test
# echo "test" | passwd --stdin test

2. Login directly as this user and confirm you are mapped as user_u, execute at job

$ id -Z
user_u:user_r:user_t:s0

$ at now + 1 min
at> date > /home/test/date.txt
at> <EOT>
job 5 at Wed Aug  4 04:26:00 2021

3. Monitor the message logs for the error.

~~~
Aug  4 04:26:00 selinuxtest-rhel7 atd[19032]: Starting job 5 (a00005019e09da) for user 'test' (1001)
Aug  4 04:26:00 selinuxtest-rhel7 systemd: Started Session 20 of user test.
Aug  4 04:26:00 selinuxtest-rhel7 systemd-logind: New session 20 of user test.
Aug  4 04:26:00 selinuxtest-rhel7 atd[19034]: Not allowed to set exec context to user_u:user_r:user_t:s0 for user  test#012: Success
Aug  4 04:26:00 selinuxtest-rhel7 systemd-logind: Removed session 20.
~~~

4. There are no Selinux AVC present for this.

# ausearch -m AVC -i
<no matches>


Actual results:
'at' job fails to complete.


Expected results:
'at' job should complete.

Additional info:

This error does not takes place on RHEL 8.

Comment 14 Jan Houska 2022-04-01 08:36:18 UTC
VERIFIED:

NEW PASS:
version: 
at-3.1.13-25.el7_9


:   Test
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [ 04:21:42 ] :: [  BEGIN   ] :: Running './at.exp test_user test_user  localhost &> output-at.txt'
:: [ 04:21:42 ] :: [   PASS   ] :: Command './at.exp test_user test_user  localhost &> output-at.txt' (Expected 0, got 0)
====================
spawn ssh -t test_user@localhost 
test_user@localhost's password: spawn at now + 1 min
at> date >  /home/test_user/date.txt 
at> <EOT>
job 1 at Fri Apr  1 04:22:00 2022
====================
:: [ 04:21:42 ] :: [   PASS   ] :: File 'output-at.txt' should contain 'job' 
:: [ 04:22:42 ] :: [   PASS   ] :: File /home/test_user/date.txt should exist 
:: [ 04:22:42 ] :: [  BEGIN   ] :: Running 'ausearch -m AVC -i &> output-ausearch.txt'
:: [ 04:22:42 ] :: [   PASS   ] :: Command 'ausearch -m AVC -i &> output-ausearch.txt' (Expected 1, got 1)
:: [ 04:22:42 ] :: [   PASS   ] :: File 'output-ausearch.txt' should contain '<no matches>' 
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   Duration: 60s
::   Assertions: 5 good, 0 bad
::   RESULT: PASS

Comment 19 errata-xmlrpc 2022-05-18 16:15:12 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (at bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:4638


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