diff options
-rw-r--r-- | meta/recipes-support/libcap/files/0001-nativesdk-libcap-Raise-the-size-of-arrays-containing.patch | 36 | ||||
-rw-r--r-- | meta/recipes-support/libcap/libcap_2.54.bb | 3 |
2 files changed, 39 insertions, 0 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..c7bf1a8b8c --- /dev/null +++ b/meta/recipes-support/libcap/files/0001-nativesdk-libcap-Raise-the-size-of-arrays-containing.patch | |||
@@ -0,0 +1,36 @@ | |||
1 | From 794cebc5732908636f22a1d9843fed3ae664899a Mon Sep 17 00:00:00 2001 | ||
2 | From: Hongxu Jia <hongxu.jia@windriver.com> | ||
3 | Date: Thu, 14 Oct 2021 15:57:36 +0800 | ||
4 | Subject: [PATCH] nativesdk-libcap: Raise the size of arrays containing dl | ||
5 | paths | ||
6 | |||
7 | This patch puts the dynamic loader path in the binaries, SYSTEM_DIRS strings | ||
8 | and lengths as well as ld.so.cache path in the dynamic loader to specific | ||
9 | sections in memory. The sections that contain paths have been allocated a 4096 | ||
10 | byte section, which is the maximum path length in linux. This will allow the | ||
11 | relocating script to parse the ELF binary, detect the section and easily replace | ||
12 | the strings in a certain path. | ||
13 | |||
14 | Upstream-Status: Inappropriate [SDK specific] | ||
15 | |||
16 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
17 | --- | ||
18 | libcap/execable.h | 2 +- | ||
19 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
20 | |||
21 | diff --git a/libcap/execable.h b/libcap/execable.h | ||
22 | index 0bcc5d4..6e2a080 100644 | ||
23 | --- a/libcap/execable.h | ||
24 | +++ b/libcap/execable.h | ||
25 | @@ -23,7 +23,7 @@ | ||
26 | #endif | ||
27 | #define __EXECABLE_H | ||
28 | |||
29 | -const char __execable_dl_loader[] __attribute((section(".interp"))) = | ||
30 | +const char __execable_dl_loader[4096] __attribute((section(".interp"))) = | ||
31 | SHARED_LOADER ; | ||
32 | |||
33 | static void __execable_parse_args(int *argc_p, char ***argv_p) | ||
34 | -- | ||
35 | 2.27.0 | ||
36 | |||
diff --git a/meta/recipes-support/libcap/libcap_2.54.bb b/meta/recipes-support/libcap/libcap_2.54.bb index 04362e7032..fe29f05483 100644 --- a/meta/recipes-support/libcap/libcap_2.54.bb +++ b/meta/recipes-support/libcap/libcap_2.54.bb | |||
@@ -13,6 +13,9 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/libs/security/linux-privs/${BPN}2/${BPN}-${ | |||
13 | file://0001-ensure-the-XATTR_NAME_CAPS-is-defined-when-it-is-use.patch \ | 13 | file://0001-ensure-the-XATTR_NAME_CAPS-is-defined-when-it-is-use.patch \ |
14 | file://0002-tests-do-not-run-target-executables.patch \ | 14 | file://0002-tests-do-not-run-target-executables.patch \ |
15 | " | 15 | " |
16 | SRC_URI:append:class-nativesdk = " \ | ||
17 | file://0001-nativesdk-libcap-Raise-the-size-of-arrays-containing.patch \ | ||
18 | " | ||
16 | SRC_URI[sha256sum] = "5091b24247999fd7a5e62bd9ac8bc761cda29f9baa0d1a2ca6a46f13891b4f0f" | 19 | SRC_URI[sha256sum] = "5091b24247999fd7a5e62bd9ac8bc761cda29f9baa0d1a2ca6a46f13891b4f0f" |
17 | 20 | ||
18 | UPSTREAM_CHECK_URI = "https://www.kernel.org/pub/linux/libs/security/linux-privs/${BPN}2/" | 21 | UPSTREAM_CHECK_URI = "https://www.kernel.org/pub/linux/libs/security/linux-privs/${BPN}2/" |