Blame SOURCES/0158-tests-disable-TEST_MSGCTL_BOGUS_ADDR-in-ipc_msg-test.patch

6f827f
From b4623939316807928680913ece9a6cefc23a73b2 Mon Sep 17 00:00:00 2001
6f827f
From: "Dmitry V. Levin" <ldv@altlinux.org>
6f827f
Date: Tue, 10 Nov 2020 08:00:00 +0000
6f827f
Subject: [PATCH 158/162] tests: disable TEST_MSGCTL_BOGUS_ADDR in ipc_msg test
6f827f
 on glibc >= 2.31
6f827f
6f827f
Starting with commit glibc-2.31~358, on every architecture where
6f827f
__ASSUME_SYSVIPC_BROKEN_MODE_T is defined, glibc tries to modify the
6f827f
data provided in the third argument of msgctl call.  This results
6f827f
to segfaults inside glibc if TEST_MSGCTL_BOGUS_ADDR is enabled.
6f827f
6f827f
* tests/ipc_msg.c [GLIBC_PREREQ_GE(2, 31) && (__m68k__ || __s390__ ||
6f827f
(WORDS_BIGENDIAN && (__arm__ || __microblaze__ || __sh__)))]
6f827f
(TEST_MSGCTL_BOGUS_ADDR): Define to 0.
6f827f
6f827f
Reported-by: Sven Schnelle <svens@linux.ibm.com>
6f827f
---
6f827f
 tests/ipc_msg.c | 11 +++++++++++
6f827f
 1 file changed, 11 insertions(+)
6f827f
6f827f
diff --git a/tests/ipc_msg.c b/tests/ipc_msg.c
6f827f
index 3ab8b90..f7c36cd 100644
6f827f
--- a/tests/ipc_msg.c
6f827f
+++ b/tests/ipc_msg.c
6f827f
@@ -31,6 +31,17 @@
6f827f
 # define TEST_MSGCTL_BOGUS_ADDR 0
6f827f
 #endif
6f827f
 /*
6f827f
+ * Starting with commit glibc-2.31~358, on every architecture where
6f827f
+ * __ASSUME_SYSVIPC_BROKEN_MODE_T is defined, glibc tries to modify
6f827f
+ * the data provided in the third argument of msgctl call.
6f827f
+ */
6f827f
+#if GLIBC_PREREQ_GE(2, 31) && \
6f827f
+ (defined __m68k__ || defined __s390__ || \
6f827f
+  (WORDS_BIGENDIAN && \
6f827f
+   (defined __arm__ || defined __microblaze__ || defined __sh__)))
6f827f
+# define TEST_MSGCTL_BOGUS_ADDR 0
6f827f
+#endif
6f827f
+/*
6f827f
  * Before glibc-2.22-122-gbe48165, ppc64 code tried to retrieve data
6f827f
  * provided in third argument of msgctl call (in case of IPC_SET cmd)
6f827f
  * which led to segmentation fault.
6f827f
diff --git a/tests-m32/ipc_msg.c b/tests-m32/ipc_msg.c
6f827f
index 3ab8b90..f7c36cd 100644
6f827f
--- a/tests-m32/ipc_msg.c
6f827f
+++ b/tests-m32/ipc_msg.c
6f827f
@@ -31,6 +31,17 @@
6f827f
 # define TEST_MSGCTL_BOGUS_ADDR 0
6f827f
 #endif
6f827f
 /*
6f827f
+ * Starting with commit glibc-2.31~358, on every architecture where
6f827f
+ * __ASSUME_SYSVIPC_BROKEN_MODE_T is defined, glibc tries to modify
6f827f
+ * the data provided in the third argument of msgctl call.
6f827f
+ */
6f827f
+#if GLIBC_PREREQ_GE(2, 31) && \
6f827f
+ (defined __m68k__ || defined __s390__ || \
6f827f
+  (WORDS_BIGENDIAN && \
6f827f
+   (defined __arm__ || defined __microblaze__ || defined __sh__)))
6f827f
+# define TEST_MSGCTL_BOGUS_ADDR 0
6f827f
+#endif
6f827f
+/*
6f827f
  * Before glibc-2.22-122-gbe48165, ppc64 code tried to retrieve data
6f827f
  * provided in third argument of msgctl call (in case of IPC_SET cmd)
6f827f
  * which led to segmentation fault.
6f827f
diff --git a/tests-mx32/ipc_msg.c b/tests-mx32/ipc_msg.c
6f827f
index 3ab8b90..f7c36cd 100644
6f827f
--- a/tests-mx32/ipc_msg.c
6f827f
+++ b/tests-mx32/ipc_msg.c
6f827f
@@ -31,6 +31,17 @@
6f827f
 # define TEST_MSGCTL_BOGUS_ADDR 0
6f827f
 #endif
6f827f
 /*
6f827f
+ * Starting with commit glibc-2.31~358, on every architecture where
6f827f
+ * __ASSUME_SYSVIPC_BROKEN_MODE_T is defined, glibc tries to modify
6f827f
+ * the data provided in the third argument of msgctl call.
6f827f
+ */
6f827f
+#if GLIBC_PREREQ_GE(2, 31) && \
6f827f
+ (defined __m68k__ || defined __s390__ || \
6f827f
+  (WORDS_BIGENDIAN && \
6f827f
+   (defined __arm__ || defined __microblaze__ || defined __sh__)))
6f827f
+# define TEST_MSGCTL_BOGUS_ADDR 0
6f827f
+#endif
6f827f
+/*
6f827f
  * Before glibc-2.22-122-gbe48165, ppc64 code tried to retrieve data
6f827f
  * provided in third argument of msgctl call (in case of IPC_SET cmd)
6f827f
  * which led to segmentation fault.
6f827f
-- 
6f827f
2.1.4
6f827f