diff --git a/0035-If-client-exit-abnormally-close-main-loop-avoid-proc.patch b/0035-If-client-exit-abnormally-close-main-loop-avoid-proc.patch new file mode 100644 index 0000000000000000000000000000000000000000..44738cd04c6ccd6d4b24a5117f73bf6729d14091 --- /dev/null +++ b/0035-If-client-exit-abnormally-close-main-loop-avoid-proc.patch @@ -0,0 +1,30 @@ +From d7eb77bd49be902d605130ab1deea5d495feea2f Mon Sep 17 00:00:00 2001 +From: tiamo0 +Date: Wed, 15 Dec 2021 10:25:04 +0800 +Subject: [PATCH] If client exit abnormally, close main loop avoid process + leak. + +Signed-off-by: tiamo0 +--- + src/lxc/terminal.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/lxc/terminal.c b/src/lxc/terminal.c +index 5d83691..6286b6d 100644 +--- a/src/lxc/terminal.c ++++ b/src/lxc/terminal.c +@@ -780,9 +780,9 @@ int lxc_terminal_io_cb(int fd, uint32_t events, void *data, + close(fd); + return LXC_MAINLOOP_CONTINUE; /* isulad: do not close mainloop when peer close*/ + } else if (lxc_terminal_is_fifo(fd, &terminal->fifos)) { +- /* isulad: delete fifos when the client close */ ++ /* isulad: delete fifos when the client close, and close mainloop */ + lxc_terminal_delete_fifo(fd, &terminal->fifos); +- return LXC_MAINLOOP_CONTINUE; ++ return LXC_MAINLOOP_CLOSE; + } else if (fd == terminal->pipes[1][0] || fd == terminal->pipes[2][0]) { + if (fd == terminal->pipes[1][0]) { + if (terminal->log_fd >= 0) { +-- +2.30.0 + diff --git a/lxc.spec b/lxc.spec index b88a005c4f5dc1521c62fe63f8d9c321b7737082..8fc42f508946a1ffc4584ea42e5202be623aabd1 100644 --- a/lxc.spec +++ b/lxc.spec @@ -42,6 +42,7 @@ Patch0031: 0031-fix-lsm_se_mount_context-memory-leak.patch Patch0032: 0032-disable-lxc_keep-with-oci-image.patch Patch0033: 0033-conf-ensure-that-the-idmap-pointer-itself-is-freed.patch Patch0034: 0034-cgfsng-fix-cgroup-attach-cgroup-creation.patch +Patch0035: 0035-If-client-exit-abnormally-close-main-loop-avoid-proc.patch BuildRequires: systemd-units git libtool graphviz docbook2X doxygen chrpath BuildRequires: pkgconfig(libseccomp) @@ -213,6 +214,12 @@ make check %{_mandir}/*/man7/%{name}* %changelog +* Wed Dec 15 2021 tiamo0 - 4.0.3-2021121501 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:close lxc-attach mainloop if client exit abnormally + * Thu Nov 25 2021 wangfengtu - 4.0.3-2021112501 - Type:bugfix - ID:NA diff --git a/series.conf b/series.conf index cffc900d9cd8e746c18bbbbfb7645618624927eb..1e628ef47f6e1c84966826f3b438baf7b7c7ea3c 100644 --- a/series.conf +++ b/series.conf @@ -32,3 +32,4 @@ 0032-disable-lxc_keep-with-oci-image.patch 0033-conf-ensure-that-the-idmap-pointer-itself-is-freed.patch 0034-cgfsng-fix-cgroup-attach-cgroup-creation.patch +0035-If-client-exit-abnormally-close-main-loop-avoid-proc.patch