diff options
-rw-r--r-- | meta-oe/recipes-connectivity/libmtp/libmtp/0002-util-mtp-hotplug.c-Enable-stack-memory-protection.patch | 33 | ||||
-rw-r--r-- | meta-oe/recipes-connectivity/libmtp/libmtp_1.1.21.bb | 3 |
2 files changed, 35 insertions, 1 deletions
diff --git a/meta-oe/recipes-connectivity/libmtp/libmtp/0002-util-mtp-hotplug.c-Enable-stack-memory-protection.patch b/meta-oe/recipes-connectivity/libmtp/libmtp/0002-util-mtp-hotplug.c-Enable-stack-memory-protection.patch new file mode 100644 index 0000000000..9cd4b2fbd6 --- /dev/null +++ b/meta-oe/recipes-connectivity/libmtp/libmtp/0002-util-mtp-hotplug.c-Enable-stack-memory-protection.patch | |||
@@ -0,0 +1,33 @@ | |||
1 | From 0644188a537a06bc6d04483b21e23b80987eb497 Mon Sep 17 00:00:00 2001 | ||
2 | From: Hieu Van Nguyen <hieu2.nguyen@lge.com> | ||
3 | Date: Fri, 11 Oct 2024 04:21:21 +0000 | ||
4 | Subject: [PATCH] util/mtp-hotplug.c: Enable stack memory protection | ||
5 | |||
6 | Use "return 0" instead of "exit(0)" at the end of main() | ||
7 | function to enable checking for Stack Overflow at Runtime. | ||
8 | |||
9 | Use "return 0" to let the program exit normally by returning from | ||
10 | the main function. This allows the compiler to perform necessary | ||
11 | cleanup operations, including stack canary checks. | ||
12 | |||
13 | __stack_chk_fail function isn't being invoked when using exit(0) at | ||
14 | the end of the main function | ||
15 | $ objdump -T ./util/.libs/mtp-hotplug | grep __stack_chk_fail | ||
16 | This return empty. | ||
17 | --- | ||
18 | Upstream-Status: Backport [https://github.com/libmtp/libmtp/commit/e89dbb6ecf244936acc9a52aa4af9635bda5926a] | ||
19 | |||
20 | util/mtp-hotplug.c | 2 +- | ||
21 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
22 | |||
23 | diff --git a/util/mtp-hotplug.c b/util/mtp-hotplug.c | ||
24 | index b5bc6da40f..db75cb38a1 100644 | ||
25 | --- a/util/mtp-hotplug.c | ||
26 | +++ b/util/mtp-hotplug.c | ||
27 | @@ -301,5 +301,5 @@ int main (int argc, char **argv) | ||
28 | printf("\n"); | ||
29 | } | ||
30 | |||
31 | - exit (0); | ||
32 | + return 0; | ||
33 | } | ||
diff --git a/meta-oe/recipes-connectivity/libmtp/libmtp_1.1.21.bb b/meta-oe/recipes-connectivity/libmtp/libmtp_1.1.21.bb index 16f82c6ba3..69dff50cd7 100644 --- a/meta-oe/recipes-connectivity/libmtp/libmtp_1.1.21.bb +++ b/meta-oe/recipes-connectivity/libmtp/libmtp_1.1.21.bb | |||
@@ -18,7 +18,8 @@ DEPENDS = "libusb1 gettext-native" | |||
18 | DEPENDS:append:class-target = " ${BPN}-native" | 18 | DEPENDS:append:class-target = " ${BPN}-native" |
19 | 19 | ||
20 | SRC_URI = "https://github.com/${BPN}/${BPN}/releases/download/v${PV}/${BP}.tar.gz" | 20 | SRC_URI = "https://github.com/${BPN}/${BPN}/releases/download/v${PV}/${BP}.tar.gz" |
21 | SRC_URI:append:class-target = " file://0001-Use-native-mtp-hotplug.patch" | 21 | SRC_URI:append:class-target = " file://0001-Use-native-mtp-hotplug.patch \ |
22 | file://0002-util-mtp-hotplug.c-Enable-stack-memory-protection.patch" | ||
22 | SRC_URI[sha256sum] = "f4c1ceb3df020a6cb851110f620c14fe399518c494ed252039cbfb4e34335135" | 23 | SRC_URI[sha256sum] = "f4c1ceb3df020a6cb851110f620c14fe399518c494ed252039cbfb4e34335135" |
23 | 24 | ||
24 | UPSTREAM_CHECK_URI = "https://github.com/libmtp/libmtp/releases" | 25 | UPSTREAM_CHECK_URI = "https://github.com/libmtp/libmtp/releases" |