From 2fe3fe9429213335992d276e3081c66ada460ced Mon Sep 17 00:00:00 2001 From: liqingqing_1229 Date: Fri, 21 Jan 2022 10:40:22 +0800 Subject: [PATCH] support: Add check for TID zero in support_wait_for_thread_exit --- glibc.spec | 8 +++- ...k-for-TID-zero-in-support_wait_for_t.patch | 42 +++++++++++++++++++ 2 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 support-Add-check-for-TID-zero-in-support_wait_for_t.patch diff --git a/glibc.spec b/glibc.spec index c7e6632..3527254 100644 --- a/glibc.spec +++ b/glibc.spec @@ -66,7 +66,7 @@ ############################################################################## Name: glibc Version: 2.34 -Release: 43 +Release: 44 Summary: The GNU libc libraries License: %{all_license} URL: http://www.gnu.org/software/glibc/ @@ -163,6 +163,7 @@ Patch75: socket-Add-the-__sockaddr_un_set-function.patch Patch76: CVE-2022-23219-Buffer-overflow-in-sunrpc-clnt_create.patch Patch77: sunrpc-Test-case-for-clnt_create-unix-buffer-overflo.patch Patch78: CVE-2022-23218-Buffer-overflow-in-sunrpc-svcunix_cre.patch +Patch79: support-Add-check-for-TID-zero-in-support_wait_for_t.patch Patch9000: turn-default-value-of-x86_rep_stosb_threshold_form_2K_to_1M.patch Patch9001: delete-no-hard-link-to-avoid-all_language-package-to.patch @@ -1365,7 +1366,10 @@ fi %endif %changelog -*Tue Jan 18 Qingqing Li - 2.34-43 +* Fri Jan 21 Qingqing Li - 2.34-44 +- support: Add check for TID zero in support_wait_for_thread_exit + +* Tue Jan 18 Qingqing Li - 2.34-43 - fix CVE-2022-23218 and CVE-2022-23219 * Tue Jan 11 2022 Yang Yanchao - 2.34-42 diff --git a/support-Add-check-for-TID-zero-in-support_wait_for_t.patch b/support-Add-check-for-TID-zero-in-support_wait_for_t.patch new file mode 100644 index 0000000..faccebf --- /dev/null +++ b/support-Add-check-for-TID-zero-in-support_wait_for_t.patch @@ -0,0 +1,42 @@ +From 176c88f5214d8107d330971cbbfbbba5186a111f Mon Sep 17 00:00:00 2001 +From: Florian Weimer +Date: Fri, 1 Oct 2021 18:16:41 +0200 +Subject: [PATCH] support: Add check for TID zero in + support_wait_for_thread_exit + +Some kernel versions (observed with kernel 5.14 and earlier) can list +"0" entries in /proc/self/task. This happens when a thread exits +while the task list is being constructed. Treat this entry as not +present, like the proposed kernel patch does: + +[PATCH] procfs: Do not list TID 0 in /proc//task + + +Fixes commit 032d74eaf6179100048a5bf0ce942e97dc8b9a60 ("support: Add +support_wait_for_thread_exit"). + +Reviewed-by: Carlos O'Donell +Tested-by: Carlos O'Donell +--- + support/support_wait_for_thread_exit.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/support/support_wait_for_thread_exit.c b/support/support_wait_for_thread_exit.c +index 658a813..5e3be42 100644 +--- a/support/support_wait_for_thread_exit.c ++++ b/support/support_wait_for_thread_exit.c +@@ -43,7 +43,10 @@ support_wait_for_thread_exit (void) + return; + } + +- if (strcmp (e->d_name, ".") == 0 || strcmp (e->d_name, "..") == 0) ++ /* In some kernels, "0" entries denote a thread that has just ++ exited. */ ++ if (strcmp (e->d_name, ".") == 0 || strcmp (e->d_name, "..") == 0 ++ || strcmp (e->d_name, "0") == 0) + continue; + + int task_tid = atoi (e->d_name); +-- +1.8.3.1 + -- Gitee