Bug 1560657
Summary: | sudo blocks in poll() for /dev/ptmx with iolog enabled | |||
---|---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Stepan Broz <sbroz> | |
Component: | sudo | Assignee: | Daniel Kopeček <dkopecek> | |
Status: | CLOSED ERRATA | QA Contact: | Dalibor Pospíšil <dapospis> | |
Severity: | high | Docs Contact: | Mirek Jahoda <mjahoda> | |
Priority: | urgent | |||
Version: | 7.4 | CC: | dapospis, dkopecek, fkrska, mjahoda, mmatsuya, rmetrich | |
Target Milestone: | rc | Keywords: | Patch, Regression, Reproducer, Triaged, ZStream | |
Target Release: | --- | |||
Hardware: | Unspecified | |||
OS: | Linux | |||
Whiteboard: | ||||
Fixed In Version: | Doc Type: | Bug Fix | ||
Doc Text: |
*sudo* no longer blocks `poll()` for `/dev/ptmx`
Previously, when running a command through *sudo* that had the I/O logging enabled, a parent process of the command was occasionally blocked in the `poll()` function execution, waiting for an event on the `/dev/ptmx` file descriptor. Consequently, a deadlock occurred and *sudo* might leave the process of the command in an unresponsive state. This update adds a pseudoterminal cleanup logic, and sudo no longer causes a deadlock in the described scenario.
|
Story Points: | --- | |
Clone Of: | ||||
: | 1582154 1582155 (view as bug list) | Environment: | ||
Last Closed: | 2018-10-30 11:09:01 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: | ||||
Bug Depends On: | 1547974 | |||
Bug Blocks: | 1549635, 1582154, 1582155 |
Description
Stepan Broz
2018-03-26 16:37:52 UTC
Created attachment 1413242 [details]
This patch prevents the blocking poll()
I was able to avoid the blocking poll using this patch.
The problem appears to be that the write_callback() schedules a reader for the master PTY file descriptor after flushing the writing buffers. The subsequent poll() that happens with a negative timeout value (-1) makes it blocking forever. Just yesterday, there was another beta version of sudo released (sudo-1.8.23b2) that contains a better fix. I couldn't reproduce the problem any more. The patch is: https://bugzilla.sudo.ws/attachment.cgi?id=505&action=diff *** Bug 1549199 has been marked as a duplicate of this bug. *** 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, 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/RHEA-2018:3199 |