Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 2024672

Summary: sessions kept open with use_pty and closed pty
Product: Red Hat Enterprise Linux 8 Reporter: Paulo Andrade <pandrade>
Component: sudoAssignee: Radovan Sroka <rsroka>
Status: CLOSED MIGRATED QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 8.4CC: dapospis, qguo, sahay
Target Milestone: rcKeywords: MigratedToJIRA
Target Release: ---Flags: pm-rhel: mirror+
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-08-30 10:54:42 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Paulo Andrade 2021-11-18 16:27:47 UTC
User does run putty to rhel, run sudo on rhel, then ssh from rhel to solaris.

  When there is a vpn timeout or putty window is closed, sessions are listed
as still open with 'w' and 'who' commands. sudo process is still running.

(gdb) bt
#0  0x00007f75f9c32ade in __GI_ppoll (fds=0x5613b0a2f260, nfds=2, timeout=<optimized out>, timeout@entry=0x0, sigmask=sigmask@entry=0x0) at ../sysdeps/unix/sysv/linux/ppoll.c:39
#1  0x00007f75fa339654 in ppoll (__ss=0x0, __timeout=0x0, __nfds=<optimized out>, __fds=<optimized out>) at /usr/include/bits/poll2.h:77
#2  sudo_ev_poll (timo=0x0, nfds=<optimized out>, fds=<optimized out>) at ./event_poll.c:148
#3  sudo_ev_scan_impl (base=base@entry=0x5613b0a55730, flags=flags@entry=0) at ./event_poll.c:184
#4  0x00007f75fa331511 in sudo_ev_loop_v1 (base=0x5613b0a55730, flags=flags@entry=0) at ./event.c:644
#5  0x00007f75fa33177b in sudo_ev_dispatch_v1 (base=<optimized out>) at ./event.c:610
#6  0x00005613b02d9f19 in exec_pty (details=details@entry=0x5613b04f11e0 <command_details>, cstat=cstat@entry=0x7fffd31f8d70) at ./exec_pty.c:1580
#7  0x00005613b02d27f3 in sudo_execute (details=0x5613b04f11e0 <command_details>, cstat=0x7fffd31f8d70) at ./exec.c:371
#8  0x00005613b02e133f in run_command (details=0x5613b04f11e0 <command_details>) at ./sudo.c:957
#9  0x00005613b02d0872 in main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>) at ./sudo.c:301

(gdb) p {struct pollfd[2]}fds
$1 = {{fd = 12, events = 1, revents = 0}, {fd = 11, events = 1, revents = 0}}

  From sosreport lsof file for the process we see:

sudo      257796        0   11r     FIFO               0,13       0t0    1049819 pipe
sudo      257796        0   12u     unix 0xffff9b2c9f8f8d80       0t0    1049813 type=STREAM

  And the pty is already closed:

sudo      257796        0    0u      CHR              136,4       0t0          7 /dev/pts/4 (deleted)
sudo      257796        0    1u      CHR              136,4       0t0          7 /dev/pts/4 (deleted)
sudo      257796        0    2u      CHR              136,4       0t0          7 /dev/pts/4 (deleted)

  A suggestion was to use the TMOUT shell variable to get the shell to exit,
but still, better to understand the issue, and it would not work if it were
not in the shell prompt.

  At first we though it could be a variant of bz#1582155 but since it is
not waiting on /dev/ptmx, it might be an unrelated issue.

Comment 4 Radovan Sroka 2023-08-16 14:36:12 UTC
This bug is going to be migrated.

Contact point for migration questions or issues: rsroka
Guidance for Bugzilla users to test their Jira account or create one if needed:

https://redhat.service-now.com/help?id=kb_article_view&sysparm_article=KB0016394
https://redhat.service-now.com/help?id=kb_article_view&sysparm_article=KB0016694
https://redhat.service-now.com/help?id=kb_article_view&sysparm_article=KB0016774

Comment 5 RHEL Program Management 2023-08-30 09:29:03 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 6 RHEL Program Management 2023-08-30 10:54:42 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues.