From f7943522cdfba038c78916b44b42c7ab0366431f Mon Sep 17 00:00:00 2001 From: liqingqing_1229 Date: Fri, 1 Jul 2022 14:56:43 +0800 Subject: [PATCH] Fix mq_timereceive check for 32bit fallback code (BZ 29304) --- glibc.spec | 6 +++- ...ereceive-check-for-32-bit-fallback-c.patch | 31 +++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 linux-Fix-mq_timereceive-check-for-32-bit-fallback-c.patch diff --git a/glibc.spec b/glibc.spec index f9325cc..7feb28f 100644 --- a/glibc.spec +++ b/glibc.spec @@ -66,7 +66,7 @@ ############################################################################## Name: glibc Version: 2.34 -Release: 88 +Release: 89 Summary: The GNU libc libraries License: %{all_license} URL: http://www.gnu.org/software/glibc/ @@ -224,6 +224,7 @@ Patch136: backport-elf-Fix-use-after-free-in-ldconfig-BZ-26779.patch Patch137: realpath-Avoid-overwriting-preexisting-error-CVE-2021-3998.patch Patch138: Linux-Avoid-closing-1-on-failure-in-__closefrom_fall.patch Patch139: Fix-deadlock-when-pthread_atfork-handler-calls-pthre.patch +Patch140: linux-Fix-mq_timereceive-check-for-32-bit-fallback-c.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 @@ -1399,6 +1400,9 @@ fi %endif %changelog +* Fri Jul 1 2022 Qingqing Li - 2.34-89 +- Fix mq_timereceive check for 32 bit fallback code (BZ 29304) + * Tue Jun 28 2022 Qingqing Li - 2.34-88 - aarch64: add -mno-outline-atomics to prevent mallocT2_xx performance regression diff --git a/linux-Fix-mq_timereceive-check-for-32-bit-fallback-c.patch b/linux-Fix-mq_timereceive-check-for-32-bit-fallback-c.patch new file mode 100644 index 0000000..ca1d348 --- /dev/null +++ b/linux-Fix-mq_timereceive-check-for-32-bit-fallback-c.patch @@ -0,0 +1,31 @@ +From 71d87d85bf54f6522813aec97c19bdd24997341e Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella +Date: Thu, 30 Jun 2022 09:08:31 -0300 +Subject: [PATCH] linux: Fix mq_timereceive check for 32 bit fallback code (BZ + 29304) + +On success, mq_receive() and mq_timedreceive() return the number of +bytes in the received message, so it requires to check if the value +is larger than 0. + +Checked on i686-linux-gnu. +--- + sysdeps/unix/sysv/linux/mq_timedreceive.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sysdeps/unix/sysv/linux/mq_timedreceive.c b/sysdeps/unix/sysv/linux/mq_timedreceive.c +index 834cd7a..5bf1e0a 100644 +--- a/sysdeps/unix/sysv/linux/mq_timedreceive.c ++++ b/sysdeps/unix/sysv/linux/mq_timedreceive.c +@@ -41,7 +41,7 @@ ___mq_timedreceive_time64 (mqd_t mqdes, char *__restrict msg_ptr, size_t msg_len + { + int r = SYSCALL_CANCEL (mq_timedreceive_time64, mqdes, msg_ptr, msg_len, + msg_prio, abs_timeout); +- if (r == 0 || errno != ENOSYS) ++ if (r >= 0 || errno != ENOSYS) + return r; + __set_errno (EOVERFLOW); + return -1; +-- +1.8.3.1 +