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 1972820 - Defaults use_pty plus SELinux ROLE in user specification breaks terminal
Summary: Defaults use_pty plus SELinux ROLE in user specification breaks terminal
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: sudo
Version: 7.9
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: rc
: ---
Assignee: Radovan Sroka
QA Contact: Dalibor Pospíšil
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-06-16 16:50 UTC by Steven Pritchard
Modified: 2024-12-20 20:16 UTC (History)
10 users (show)

Fixed In Version: sudo-1.8.23-10.el7_9.2
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-10-12 15:31:00 UTC
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2021:3806 0 None None None 2021-10-12 15:31:02 UTC

Description Steven Pritchard 2021-06-16 16:50:55 UTC
Description of problem:
The combination of

  Defaults use_pty

and ROLE= in a user specification like this:

  vagrant        ALL=(ALL)       ROLE=unconfined_r NOPASSWD: ALL

causes this behavior:

  [vagrant@rhel7 ~]$ sudo -i
  -bash: cannot set terminal process group (-1): Inappropriate ioctl for device
                                                                               -bash: no job control in this shell
                                  [root@rhel7 ~]# 

Note that this happens even if there is no role transition.  In the example above, the vagrant user is already unconfined.

Version-Release number of selected component (if applicable):
sudo-1.8.23-10.el7_9.1.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Add "Defaults use_pty" to /etc/sudoers (as required by CIS RHEL 7 Benchmark v3.0.1 rule 1.3.2)
2. Add "ROLE=unconfined_r" to a user specification
3. Run any allowed command with sudo as that user

Actual results:
[vagrant@rhel7 ~]$ sudo -i
-bash: cannot set terminal process group (-1): Inappropriate ioctl for device
                                                                             -bash: no job control in this shell
                                [root@rhel7 ~]# 


Expected results:
[vagrant@rhel7 ~]$ sudo -i
[root@rhel7 ~]# 

Additional info:
This bug was fixed upstream in https://github.com/sudo-project/sudo/commit/112dff276aaf1f88b4931e290b5b62645f837815.

Comment 28 errata-xmlrpc 2021-10-12 15:31:00 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 (sudo 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-2021:3806


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