diff options
Diffstat (limited to 'meta/recipes-support/libcap/files')
3 files changed, 39 insertions, 57 deletions
diff --git a/meta/recipes-support/libcap/files/0001-nativesdk-libcap-Raise-the-size-of-arrays-containing.patch b/meta/recipes-support/libcap/files/0001-nativesdk-libcap-Raise-the-size-of-arrays-containing.patch new file mode 100644 index 0000000000..2ac1e6e560 --- /dev/null +++ b/meta/recipes-support/libcap/files/0001-nativesdk-libcap-Raise-the-size-of-arrays-containing.patch @@ -0,0 +1,34 @@ +From 709aa8e156415215b0bb034d05b2aa2f44be044e Mon Sep 17 00:00:00 2001 +From: Hongxu Jia <hongxu.jia@windriver.com> +Date: Thu, 14 Oct 2021 15:57:36 +0800 +Subject: [PATCH] nativesdk-libcap: Raise the size of arrays containing dl + paths + +This patch puts the dynamic loader path in the binaries, SYSTEM_DIRS strings +and lengths as well as ld.so.cache path in the dynamic loader to specific +sections in memory. The sections that contain paths have been allocated a 4096 +byte section, which is the maximum path length in linux. This will allow the +relocating script to parse the ELF binary, detect the section and easily replace +the strings in a certain path. + +Upstream-Status: Inappropriate [SDK specific] + +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +--- + libcap/execable.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libcap/execable.h b/libcap/execable.h +index fee17b4..5bb0c55 100644 +--- a/libcap/execable.h ++++ b/libcap/execable.h +@@ -23,7 +23,7 @@ + #endif + #define __EXECABLE_H + +-const char __execable_dl_loader[] __attribute((section(".interp"))) = ++const char __execable_dl_loader[4096] __attribute((section(".interp"))) = + SHARED_LOADER ; + + static void __execable_parse_args(int *argc_p, char ***argv_p) diff --git a/meta/recipes-support/libcap/files/0001-tests-do-not-statically-link-a-test.patch b/meta/recipes-support/libcap/files/0001-tests-do-not-statically-link-a-test.patch deleted file mode 100644 index d2653afb75..0000000000 --- a/meta/recipes-support/libcap/files/0001-tests-do-not-statically-link-a-test.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 6aa15fe548e5b1d6ca3b373779beb7521ea95ba9 Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin <alex.kanavin@gmail.com> -Date: Wed, 15 Jan 2020 17:16:28 +0100 -Subject: [PATCH] tests: do not statically link a test - -This fails on e.g. centos 7 - -Upstream-Status: Inappropriate [oe-core specific] -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> ---- - progs/Makefile | 2 +- - tests/Makefile | 4 ++-- - 2 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/progs/Makefile b/progs/Makefile -index 1d7fc7a..37db8f7 100644 ---- a/progs/Makefile -+++ b/progs/Makefile -@@ -42,7 +42,7 @@ endif - test: $(PROGS) - - tcapsh-static: capsh.c $(DEPS) -- $(CC) $(IPATH) $(CAPSH_SHELL) $(CFLAGS) -o $@ $< $(LIBCAPLIB) $(LDFLAGS) --static -+ $(CC) $(IPATH) $(CAPSH_SHELL) $(CFLAGS) -o $@ $< $(LIBCAPLIB) $(LDFLAGS) - - sudotest: test tcapsh-static - sudo $(LDPATH) ./quicktest.sh -diff --git a/tests/Makefile b/tests/Makefile -index 01f7589..094ec57 100644 ---- a/tests/Makefile -+++ b/tests/Makefile -@@ -22,7 +22,7 @@ ifeq ($(PTHREADS),yes) - DEPS += ../libcap/libpsx.so - endif - else --LDFLAGS += --static -+LDFLAGS += - DEPS=../libcap/libcap.a - ifeq ($(PTHREADS),yes) - DEPS += ../libcap/libpsx.a -@@ -106,7 +106,7 @@ noexploit: exploit.o $(DEPS) - - # This one runs in a chroot with no shared library files. - noop: noop.c -- $(CC) $(CFLAGS) $< -o $@ --static -+ $(CC) $(CFLAGS) $< -o $@ - - clean: - rm -f psx_test libcap_psx_test libcap_launch_test *~ --- -2.17.1 - diff --git a/meta/recipes-support/libcap/files/0002-tests-do-not-run-target-executables.patch b/meta/recipes-support/libcap/files/0002-tests-do-not-run-target-executables.patch index 69287152eb..20346cf2fb 100644 --- a/meta/recipes-support/libcap/files/0002-tests-do-not-run-target-executables.patch +++ b/meta/recipes-support/libcap/files/0002-tests-do-not-run-target-executables.patch @@ -1,4 +1,4 @@ -From 652071e430d5eea758965176b7648e79ad404daa Mon Sep 17 00:00:00 2001 +From 10212b6d4e8843feffbeab5336342d97f3a46bb2 Mon Sep 17 00:00:00 2001 From: Alexander Kanavin <alex.kanavin@gmail.com> Date: Fri, 20 Dec 2019 16:54:05 +0100 Subject: [PATCH] tests: do not run target executables @@ -11,20 +11,20 @@ Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> 1 file changed, 2 deletions(-) diff --git a/tests/Makefile b/tests/Makefile -index fc39fee..3431df9 100644 +index ecb7d1b..8950c73 100644 --- a/tests/Makefile +++ b/tests/Makefile -@@ -59,13 +59,11 @@ endif +@@ -61,13 +61,11 @@ endif # unprivileged run_psx_test: psx_test - ./psx_test psx_test: psx_test.c $(DEPS) - $(CC) $(CFLAGS) $(IPATH) $< -o $@ $(LINKEXTRA) $(LIBPSXLIB) $(LDFLAGS) + $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $< -o $@ $(LINKEXTRA) $(LIBPSXLIB) run_libcap_psx_test: libcap_psx_test - ./libcap_psx_test libcap_psx_test: libcap_psx_test.c $(DEPS) - $(CC) $(CFLAGS) $(IPATH) $< -o $@ $(LINKEXTRA) $(LIBCAPLIB) $(LIBPSXLIB) $(LDFLAGS) + $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $< -o $@ $(LINKEXTRA) $(LIBCAPLIB) $(LIBPSXLIB) |