]> git.ipfire.org Git - thirdparty/lxc.git/commit
lxc_setup_tios(): Ignore SIGTTOU and SIGTTIN signals 1386/head
authorThomas Jarosch <thomas.jarosch@intra2net.com>
Thu, 2 Feb 2017 11:48:35 +0000 (12:48 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Tue, 4 Apr 2017 14:53:04 +0000 (16:53 +0200)
commit6aae6d0231921093f596f1113432c157d2b343f5
treec317f21ad17d8c944a6ae34876021ca07f2560fa
parent99e98d9afa2bea1d299859d35f7547ef9e2fabe6
lxc_setup_tios(): Ignore SIGTTOU and SIGTTIN signals

Prevent an endless loop while executing lxc-attach in the background:

The kernel might fire SIGTTOU while an ioctl() in tcsetattr()
is executed. When the ioctl() is resumed and retries,
the signal handler interrupts it again.

We can't configure the TTY to stop sending
the signals in the first place since that
is a modification/write to the TTY already.

Still we clear the TOSTOP flag to prevent further signals.

Command to reproduce the hang:
----------------------------
cat > lxc_hang.sh << EOF
/usr/bin/timeout 5s /usr/bin/lxc-attach -n SOMECONTAINER -- /bin/true
EOF
sh lxc_hang.sh    # hangs
----------------------------

Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
src/lxc/console.c