[Bug 1895757] [NEW] Terminal hangs running sudo when "use_pty" is set in /etc/sudoers
Alejandro Santoyo Gonzalez
1895757 at bugs.launchpad.net
Tue Sep 15 22:52:28 UTC 2020
Public bug reported:
An SSH terminal into an Ubuntu server (tested on 18.04.5) hangs running
a command using 'sudo' when 'use_pty' is set in /etc/sudoers.
Steps to reproduce ('sudo' version --> 1.8.21p2-3ubuntu1.2):
1) Log in into an Ubuntu server (tested on 18.04.5 using SSH)
2) Ensure that /etc/sudoers has the following line (add this line if not present)
Defaults use_pty
3) Execute the following:
for i in {1..10}; do sudo -- cat /var/log/syslog; done
The terminal hangs and the following backtrace is obtained:
(gdb) bt
#0 0x00007f751d5c8cc4 in __GI___poll (fds=0x55d0159917b0, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1 0x00007f751d8b146a in poll (__timeout=<optimized out>, __nfds=<optimized out>, __fds=<optimized out>) at /usr/include/x86_64-linux-gnu/bits/poll2.h:46
#2 sudo_ev_scan_impl (base=base at entry=0x55d015990dc0, flags=flags at entry=0) at ../../../lib/util/event_poll.c:155
#3 0x00007f751d8aa74d in sudo_ev_loop_v1 (base=base at entry=0x55d015990dc0, flags=flags at entry=0) at ../../../lib/util/event.c:617
#4 0x000055d01570597a in del_io_events (nonblocking=nonblocking at entry=false) at ../../src/exec_pty.c:1537
#5 0x000055d015707b97 in pty_close (cstat=0x7ffd074d6110) at ../../src/exec_pty.c:697
#6 exec_pty (details=details at entry=0x55d01591e0e0 <command_details>, cstat=cstat at entry=0x7ffd074d6110) at ../../src/exec_pty.c:1412
#7 0x000055d015701178 in sudo_execute (details=0x55d01591e0e0 <command_details>, cstat=0x7ffd074d6110) at ../../src/exec.c:391
#8 0x000055d01570e15b in run_command (details=0x55d01591e0e0 <command_details>) at ../../src/sudo.c:968
#9 0x000055d0156ff9a0 in main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>) at ../../src/sudo.c:294
A similar (most likely the same) bug has been reported here
https://access.redhat.com/solutions/3404401.
** Affects: sudo (Ubuntu)
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to sudo in Ubuntu.
https://bugs.launchpad.net/bugs/1895757
Title:
Terminal hangs running sudo when "use_pty" is set in /etc/sudoers
Status in sudo package in Ubuntu:
New
Bug description:
An SSH terminal into an Ubuntu server (tested on 18.04.5) hangs
running a command using 'sudo' when 'use_pty' is set in /etc/sudoers.
Steps to reproduce ('sudo' version --> 1.8.21p2-3ubuntu1.2):
1) Log in into an Ubuntu server (tested on 18.04.5 using SSH)
2) Ensure that /etc/sudoers has the following line (add this line if not present)
Defaults use_pty
3) Execute the following:
for i in {1..10}; do sudo -- cat /var/log/syslog; done
The terminal hangs and the following backtrace is obtained:
(gdb) bt
#0 0x00007f751d5c8cc4 in __GI___poll (fds=0x55d0159917b0, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1 0x00007f751d8b146a in poll (__timeout=<optimized out>, __nfds=<optimized out>, __fds=<optimized out>) at /usr/include/x86_64-linux-gnu/bits/poll2.h:46
#2 sudo_ev_scan_impl (base=base at entry=0x55d015990dc0, flags=flags at entry=0) at ../../../lib/util/event_poll.c:155
#3 0x00007f751d8aa74d in sudo_ev_loop_v1 (base=base at entry=0x55d015990dc0, flags=flags at entry=0) at ../../../lib/util/event.c:617
#4 0x000055d01570597a in del_io_events (nonblocking=nonblocking at entry=false) at ../../src/exec_pty.c:1537
#5 0x000055d015707b97 in pty_close (cstat=0x7ffd074d6110) at ../../src/exec_pty.c:697
#6 exec_pty (details=details at entry=0x55d01591e0e0 <command_details>, cstat=cstat at entry=0x7ffd074d6110) at ../../src/exec_pty.c:1412
#7 0x000055d015701178 in sudo_execute (details=0x55d01591e0e0 <command_details>, cstat=0x7ffd074d6110) at ../../src/exec.c:391
#8 0x000055d01570e15b in run_command (details=0x55d01591e0e0 <command_details>) at ../../src/sudo.c:968
#9 0x000055d0156ff9a0 in main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>) at ../../src/sudo.c:294
A similar (most likely the same) bug has been reported here
https://access.redhat.com/solutions/3404401.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/sudo/+bug/1895757/+subscriptions
More information about the foundations-bugs
mailing list