summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/busybox
diff options
context:
space:
mode:
authorAndre McCurdy <armccurdy@gmail.com>2016-01-22 12:39:08 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-26 22:31:58 +0000
commitfa801e775d379c8f1ca55fd49e3225e8f596c1fa (patch)
treec2a48750e81e720c9689c62dc6483a042313803c /meta/recipes-core/busybox
parent6996b26d33fd7367e2281c1a0fde1dbd391e1768 (diff)
downloadpoky-fa801e775d379c8f1ca55fd49e3225e8f596c1fa.tar.gz
busybox: backport upstream truncate open mode fix
https://git.busybox.net/busybox/commit/?h=1_24_stable&id=be729c1d3b5c923f10871dd68ea94156d0f8c803 (From OE-Core rev: 123958a4b098fae32fe46552bddec21266698cfa) Signed-off-by: Andre McCurdy <armccurdy@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/busybox')
-rw-r--r--meta/recipes-core/busybox/busybox/busybox-1.24.1-truncate-open-mode.patch81
-rw-r--r--meta/recipes-core/busybox/busybox_1.24.1.bb1
2 files changed, 82 insertions, 0 deletions
diff --git a/meta/recipes-core/busybox/busybox/busybox-1.24.1-truncate-open-mode.patch b/meta/recipes-core/busybox/busybox/busybox-1.24.1-truncate-open-mode.patch
new file mode 100644
index 0000000000..cdc91082bc
--- /dev/null
+++ b/meta/recipes-core/busybox/busybox/busybox-1.24.1-truncate-open-mode.patch
@@ -0,0 +1,81 @@
1Upstream-Status: Backport
2
3 http://busybox.net/downloads/fixes-1.24.1/
4 https://git.busybox.net/busybox/commit/?id=e111a1640494fe87fc913f94fae3bb805de0fc99
5 https://git.busybox.net/busybox/commit/?h=1_24_stable&id=be729c1d3b5c923f10871dd68ea94156d0f8c803
6
7Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
8
9From be729c1d3b5c923f10871dd68ea94156d0f8c803 Mon Sep 17 00:00:00 2001
10From: Ari Sundholm <ari@tuxera.com>
11Date: Mon, 4 Jan 2016 15:40:37 +0200
12Subject: [PATCH] truncate: always set mode when opening file to avoid fortify
13 errors
14
15Busybox crashes due to no mode being given when opening:
16$ ./busybox truncate -s 1M foo
17*** invalid open64 call: O_CREAT without mode ***: ./busybox terminated
18======= Backtrace: =========
19/lib/x86_64-linux-gnu/libc.so.6(+0x7338f)[0x7f66d921338f]
20/lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x5c)[0x7f66d92aac9c]
21/lib/x86_64-linux-gnu/libc.so.6(+0xeb6aa)[0x7f66d928b6aa]
22./busybox[0x4899f9]
23======= Memory map: ========
2400400000-004d0000 r-xp 00000000 00:1a 137559 /home/ari/busybox/busybox
25006cf000-006d0000 r--p 000cf000 00:1a 137559 /home/ari/busybox/busybox
26006d0000-006d1000 rw-p 000d0000 00:1a 137559 /home/ari/busybox/busybox
27006d1000-006d4000 rw-p 00000000 00:00 0
28014e7000-01508000 rw-p 00000000 00:00 0 [heap]
297f66d8f8a000-7f66d8fa0000 r-xp 00000000 08:07 1579008 /lib/x86_64-linux-gnu/libgcc_s.so.1
307f66d8fa0000-7f66d919f000 ---p 00016000 08:07 1579008 /lib/x86_64-linux-gnu/libgcc_s.so.1
317f66d919f000-7f66d91a0000 rw-p 00015000 08:07 1579008 /lib/x86_64-linux-gnu/libgcc_s.so.1
327f66d91a0000-7f66d935b000 r-xp 00000000 08:07 1578994 /lib/x86_64-linux-gnu/libc-2.19.so
337f66d935b000-7f66d955a000 ---p 001bb000 08:07 1578994 /lib/x86_64-linux-gnu/libc-2.19.so
347f66d955a000-7f66d955e000 r--p 001ba000 08:07 1578994 /lib/x86_64-linux-gnu/libc-2.19.so
357f66d955e000-7f66d9560000 rw-p 001be000 08:07 1578994 /lib/x86_64-linux-gnu/libc-2.19.so
367f66d9560000-7f66d9565000 rw-p 00000000 00:00 0
377f66d9565000-7f66d966a000 r-xp 00000000 08:07 1579020 /lib/x86_64-linux-gnu/libm-2.19.so
387f66d966a000-7f66d9869000 ---p 00105000 08:07 1579020 /lib/x86_64-linux-gnu/libm-2.19.so
397f66d9869000-7f66d986a000 r--p 00104000 08:07 1579020 /lib/x86_64-linux-gnu/libm-2.19.so
407f66d986a000-7f66d986b000 rw-p 00105000 08:07 1579020 /lib/x86_64-linux-gnu/libm-2.19.so
417f66d986b000-7f66d988e000 r-xp 00000000 08:07 1578981 /lib/x86_64-linux-gnu/ld-2.19.so
427f66d9a64000-7f66d9a67000 rw-p 00000000 00:00 0
437f66d9a8a000-7f66d9a8d000 rw-p 00000000 00:00 0
447f66d9a8d000-7f66d9a8e000 r--p 00022000 08:07 1578981 /lib/x86_64-linux-gnu/ld-2.19.so
457f66d9a8e000-7f66d9a8f000 rw-p 00023000 08:07 1578981 /lib/x86_64-linux-gnu/ld-2.19.so
467f66d9a8f000-7f66d9a90000 rw-p 00000000 00:00 0
477ffc47761000-7ffc47782000 rw-p 00000000 00:00 0 [stack]
487ffc477ab000-7ffc477ad000 r-xp 00000000 00:00 0 [vdso]
49ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
50Aborted (core dumped)
51$
52
53Fix this by simply always setting the mode, as it doesn't hurt even
54when O_CREAT is not specified.
55
56This bug is a regression introduced in fc3e40e, as xopen(), which
57was originally used, would automatically set the mode.
58
59Signed-off-by: Ari Sundholm <ari@tuxera.com>
60Signed-off-by: Mike Frysinger <vapier@gentoo.org>
61(cherry picked from commit e111a1640494fe87fc913f94fae3bb805de0fc99)
62---
63 coreutils/truncate.c | 2 +-
64 1 file changed, 1 insertion(+), 1 deletion(-)
65
66diff --git a/coreutils/truncate.c b/coreutils/truncate.c
67index e5fa656..4c997bf 100644
68--- a/coreutils/truncate.c
69+++ b/coreutils/truncate.c
70@@ -64,7 +64,7 @@ int truncate_main(int argc UNUSED_PARAM, char **argv)
71
72 argv += optind;
73 while (*argv) {
74- int fd = open(*argv, flags);
75+ int fd = open(*argv, flags, 0666);
76 if (fd < 0) {
77 if (errno != ENOENT || !(opts & OPT_NOCREATE)) {
78 bb_perror_msg("%s: open", *argv);
79--
802.6.2
81
diff --git a/meta/recipes-core/busybox/busybox_1.24.1.bb b/meta/recipes-core/busybox/busybox_1.24.1.bb
index 8adee53911..72c5c79cde 100644
--- a/meta/recipes-core/busybox/busybox_1.24.1.bb
+++ b/meta/recipes-core/busybox/busybox_1.24.1.bb
@@ -34,6 +34,7 @@ SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
34 file://0002-Passthrough-r-to-linker.patch \ 34 file://0002-Passthrough-r-to-linker.patch \
35 file://busybox-1.24.1-unzip.patch \ 35 file://busybox-1.24.1-unzip.patch \
36 file://busybox-1.24.1-unzip-regression.patch \ 36 file://busybox-1.24.1-unzip-regression.patch \
37 file://busybox-1.24.1-truncate-open-mode.patch \
37 file://mount-via-label.cfg \ 38 file://mount-via-label.cfg \
38 file://sha1sum.cfg \ 39 file://sha1sum.cfg \
39 file://sha256sum.cfg \ 40 file://sha256sum.cfg \