diff options
| author | Khem Raj <raj.khem@gmail.com> | 2025-11-19 11:58:40 -0800 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2025-11-19 12:00:45 -0800 |
| commit | 7a259812020820d6176b2d0c9f16e1309f180ff0 (patch) | |
| tree | 5b3dc747876210bf215d69d0a8e4d157761989bb /meta-networking/recipes-support | |
| parent | cdca1c9a636f97988a6625902824c46dfafbaaec (diff) | |
| download | meta-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')
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 @@ | |||
| 1 | From 824fc568c39a682f180a34a6f581c6255f8cfc95 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Wed, 19 Nov 2025 11:49:10 -0800 | ||
| 4 | Subject: [PATCH] func_tests: disable FORTIFY_SOURCE for test_1_to_1_recvfrom | ||
| 5 | MIME-Version: 1.0 | ||
| 6 | Content-Type: text/plain; charset=UTF-8 | ||
| 7 | Content-Transfer-Encoding: 8bit | ||
| 8 | |||
| 9 | When built with glibc hardening (_FORTIFY_SOURCE), recvfrom() is wrapped by | ||
| 10 | __recvfrom_chk(). The test_1_to_1_recvfrom test deliberately calls | ||
| 11 | recvfrom() with an invalid buffer pointer ((char *)-1) to verify that | ||
| 12 | EFAULT is returned. | ||
| 13 | |||
| 14 | On fortified builds, __recvfrom_chk() sees a buffer size of 0 and a | ||
| 15 | non-zero length, treats this as a buffer overflow, and aborts with: | ||
| 16 | |||
| 17 | *** buffer overflow detected ***: terminated | ||
| 18 | |||
| 19 | This causes the test to fail with SIGABRT instead of exercising the | ||
| 20 | kernel’s EFAULT path as intended. | ||
| 21 | |||
| 22 | Compile test_1_to_1_recvfrom without _FORTIFY_SOURCE | ||
| 23 | so that the test can run to completion and correctly validate the | ||
| 24 | EFAULT behavior, while keeping fortify enabled for the rest of code | ||
| 25 | |||
| 26 | Upstream-Status: Submitted [https://github.com/sctp/lksctp-tools/pull/67] | ||
| 27 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 28 | --- | ||
| 29 | src/func_tests/Makefile.am | 5 +++++ | ||
| 30 | 1 file changed, 5 insertions(+) | ||
| 31 | |||
| 32 | diff --git a/src/func_tests/Makefile.am b/src/func_tests/Makefile.am | ||
| 33 | index 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 | ||
| 13 | SRC_URI = " \ | 13 | SRC_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 \ |
