summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-support
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2025-11-19 11:58:40 -0800
committerKhem Raj <raj.khem@gmail.com>2025-11-19 12:00:45 -0800
commit7a259812020820d6176b2d0c9f16e1309f180ff0 (patch)
tree5b3dc747876210bf215d69d0a8e4d157761989bb /meta-networking/recipes-support
parentcdca1c9a636f97988a6625902824c46dfafbaaec (diff)
downloadmeta-openembedded-7a259812020820d6176b2d0c9f16e1309f180ff0.tar.gz
lkcp-tools: Fix test_1_to_1_recvfrom ptest failure
Build it with fortify disabled to get the intended behavior of the test Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-networking/recipes-support')
-rw-r--r--meta-networking/recipes-support/lksctp-tools/lksctp-tools/0001-func_tests-disable-FORTIFY_SOURCE-for-test_1_to_1_re.patch47
-rw-r--r--meta-networking/recipes-support/lksctp-tools/lksctp-tools_1.0.21.bb1
2 files changed, 48 insertions, 0 deletions
diff --git a/meta-networking/recipes-support/lksctp-tools/lksctp-tools/0001-func_tests-disable-FORTIFY_SOURCE-for-test_1_to_1_re.patch b/meta-networking/recipes-support/lksctp-tools/lksctp-tools/0001-func_tests-disable-FORTIFY_SOURCE-for-test_1_to_1_re.patch
new file mode 100644
index 0000000000..965bcef490
--- /dev/null
+++ b/meta-networking/recipes-support/lksctp-tools/lksctp-tools/0001-func_tests-disable-FORTIFY_SOURCE-for-test_1_to_1_re.patch
@@ -0,0 +1,47 @@
1From 824fc568c39a682f180a34a6f581c6255f8cfc95 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 19 Nov 2025 11:49:10 -0800
4Subject: [PATCH] func_tests: disable FORTIFY_SOURCE for test_1_to_1_recvfrom
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9When built with glibc hardening (_FORTIFY_SOURCE), recvfrom() is wrapped by
10__recvfrom_chk(). The test_1_to_1_recvfrom test deliberately calls
11recvfrom() with an invalid buffer pointer ((char *)-1) to verify that
12EFAULT is returned.
13
14On fortified builds, __recvfrom_chk() sees a buffer size of 0 and a
15non-zero length, treats this as a buffer overflow, and aborts with:
16
17 *** buffer overflow detected ***: terminated
18
19This causes the test to fail with SIGABRT instead of exercising the
20kernel’s EFAULT path as intended.
21
22Compile test_1_to_1_recvfrom without _FORTIFY_SOURCE
23so that the test can run to completion and correctly validate the
24EFAULT behavior, while keeping fortify enabled for the rest of code
25
26Upstream-Status: Submitted [https://github.com/sctp/lksctp-tools/pull/67]
27Signed-off-by: Khem Raj <raj.khem@gmail.com>
28---
29 src/func_tests/Makefile.am | 5 +++++
30 1 file changed, 5 insertions(+)
31
32diff --git a/src/func_tests/Makefile.am b/src/func_tests/Makefile.am
33index 54e1627..e001d17 100644
34--- a/src/func_tests/Makefile.am
35+++ b/src/func_tests/Makefile.am
36@@ -160,6 +160,11 @@ test_1_to_1_events_SOURCES = test_1_to_1_events.c
37 test_1_to_1_threads_SOURCES = test_1_to_1_threads.c
38 test_1_to_1_initmsg_connect_SOURCES = test_1_to_1_initmsg_connect.c
39
40+#
41+# Disable _FORTIFY_SOURCE for this test so that the EFAULT case works
42+#
43+test_1_to_1_recvfrom_CFLAGS = $(AM_CFLAGS) -U_FORTIFY_SOURCE
44+
45 #
46 # Specifying objects rules for "v6test"
47 #
diff --git a/meta-networking/recipes-support/lksctp-tools/lksctp-tools_1.0.21.bb b/meta-networking/recipes-support/lksctp-tools/lksctp-tools_1.0.21.bb
index 407194792f..3ad436724d 100644
--- a/meta-networking/recipes-support/lksctp-tools/lksctp-tools_1.0.21.bb
+++ b/meta-networking/recipes-support/lksctp-tools/lksctp-tools_1.0.21.bb
@@ -12,6 +12,7 @@ SRCREV = "37d5f1225573b91d706a5e547d081f79963a9deb"
12 12
13SRC_URI = " \ 13SRC_URI = " \
14 git://github.com/sctp/lksctp-tools.git;branch=master;protocol=https \ 14 git://github.com/sctp/lksctp-tools.git;branch=master;protocol=https \
15 file://0001-func_tests-disable-FORTIFY_SOURCE-for-test_1_to_1_re.patch \
15 file://run-ptest \ 16 file://run-ptest \
16 file://v4test.sh \ 17 file://v4test.sh \
17 file://v6test.sh \ 18 file://v6test.sh \