summaryrefslogtreecommitdiffstats
path: root/recipes-core
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-core')
-rw-r--r--recipes-core/dbus/dbus_1.8.2.bbappend5
-rw-r--r--recipes-core/dbus/files/CVE-2014-3532.patch112
-rw-r--r--recipes-core/util-linux/util-linux/avoid_parallel_tests.patch19
-rw-r--r--recipes-core/util-linux/util-linux/avoid_unsupported_find_opts.patch38
-rw-r--r--recipes-core/util-linux/util-linux/avoid_unsupported_grep_opts.patch57
-rw-r--r--recipes-core/util-linux/util-linux/avoid_unsupported_sleep_param.patch20
-rw-r--r--recipes-core/util-linux/util-linux/display_testname_for_subtest.patch17
-rw-r--r--recipes-core/util-linux/util-linux/ptest.patch16
-rw-r--r--recipes-core/util-linux/util-linux/run-ptest10
-rw-r--r--recipes-core/util-linux/util-linux_%.bbappend41
10 files changed, 335 insertions, 0 deletions
diff --git a/recipes-core/dbus/dbus_1.8.2.bbappend b/recipes-core/dbus/dbus_1.8.2.bbappend
new file mode 100644
index 0000000..3a6cb06
--- /dev/null
+++ b/recipes-core/dbus/dbus_1.8.2.bbappend
@@ -0,0 +1,5 @@
1FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
2
3SRC_URI += "\
4 file://CVE-2014-3532.patch \
5 "
diff --git a/recipes-core/dbus/files/CVE-2014-3532.patch b/recipes-core/dbus/files/CVE-2014-3532.patch
new file mode 100644
index 0000000..95f110c
--- /dev/null
+++ b/recipes-core/dbus/files/CVE-2014-3532.patch
@@ -0,0 +1,112 @@
1Date: Tue, 24 Jun 2014 17:57:14 +0100
2Subject: Handle ETOOMANYREFS when sending recursive fds (SCM_RIGHTS)
3
4Since Linux commit 25888e (from 2.6.37-rc4, Nov 2010), sendmsg() on Unix
5sockets returns -1 errno=ETOOMANYREFS ("Too many references: cannot splice")
6when the passfd mechanism (SCM_RIGHTS) is "abusively" used recursively by
7applications. A malicious client could use this to force a victim system
8service to be disconnected from the system bus; the victim would likely
9respond by exiting. This is a denial of service (fd.o #80163,
10CVE-2014-3532).
11
12This patch silently drops the D-Bus message on ETOOMANYREFS and does not close
13the connection.
14
15Upstream-Status: Backport
16
17Bug: https://bugs.freedesktop.org/show_bug.cgi?id=80163
18Reviewed-by: Thiago Macieira <thiago@kde.org>
19[altered commit message to explain DoS significance -smcv]
20Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
21Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
22
23diff --git a/dbus/dbus-sysdeps.c b/dbus/dbus-sysdeps.c
24index de3a18c..f4ba0fa 100644
25--- a/dbus/dbus-sysdeps.c
26+++ b/dbus/dbus-sysdeps.c
27@@ -762,6 +762,20 @@ _dbus_get_is_errno_epipe (void)
28 }
29
30 /**
31+ * See if errno is ETOOMANYREFS
32+ * @returns #TRUE if errno == ETOOMANYREFS
33+ */
34+dbus_bool_t
35+_dbus_get_is_errno_etoomanyrefs (void)
36+{
37+#ifdef ETOOMANYREFS
38+ return errno == ETOOMANYREFS;
39+#else
40+ return FALSE;
41+#endif
42+}
43+
44+/**
45 * Get error message from errno
46 * @returns _dbus_strerror(errno)
47 */
48diff --git a/dbus/dbus-sysdeps.h b/dbus/dbus-sysdeps.h
49index e586946..21033eb 100644
50--- a/dbus/dbus-sysdeps.h
51+++ b/dbus/dbus-sysdeps.h
52@@ -384,6 +384,7 @@ dbus_bool_t _dbus_get_is_errno_eagain_or_ewouldblock (void);
53 dbus_bool_t _dbus_get_is_errno_enomem (void);
54 dbus_bool_t _dbus_get_is_errno_eintr (void);
55 dbus_bool_t _dbus_get_is_errno_epipe (void);
56+dbus_bool_t _dbus_get_is_errno_etoomanyrefs (void);
57 const char* _dbus_strerror_from_errno (void);
58
59 void _dbus_disable_sigpipe (void);
60diff --git a/dbus/dbus-transport-socket.c b/dbus/dbus-transport-socket.c
61index 774f459..199d3b5 100644
62--- a/dbus/dbus-transport-socket.c
63+++ b/dbus/dbus-transport-socket.c
64@@ -645,12 +645,44 @@ do_writing (DBusTransport *transport)
65 {
66 /* EINTR already handled for us */
67
68- /* For some discussion of why we also ignore EPIPE here, see
69+ /* If the other end closed the socket with close() or shutdown(), we
70+ * receive EPIPE here but we must not close the socket yet: there
71+ * might still be some data to read. See:
72 * http://lists.freedesktop.org/archives/dbus/2008-March/009526.html
73 */
74
75 if (_dbus_get_is_errno_eagain_or_ewouldblock () || _dbus_get_is_errno_epipe ())
76 goto out;
77+
78+ /* Since Linux commit 25888e (from 2.6.37-rc4, Nov 2010), sendmsg()
79+ * on Unix sockets returns -1 errno=ETOOMANYREFS when the passfd
80+ * mechanism (SCM_RIGHTS) is used recursively with a recursion level
81+ * of maximum 4. The kernel does not have an API to check whether
82+ * the passed fds can be forwarded and it can change asynchronously.
83+ * See:
84+ * https://bugs.freedesktop.org/show_bug.cgi?id=80163
85+ */
86+
87+ else if (_dbus_get_is_errno_etoomanyrefs ())
88+ {
89+ /* We only send fds in the first byte of the message.
90+ * ETOOMANYREFS cannot happen after.
91+ */
92+ _dbus_assert (socket_transport->message_bytes_written == 0);
93+
94+ _dbus_verbose (" discard message of %d bytes due to ETOOMANYREFS\n",
95+ total_bytes_to_write);
96+
97+ socket_transport->message_bytes_written = 0;
98+ _dbus_string_set_length (&socket_transport->encoded_outgoing, 0);
99+ _dbus_string_compact (&socket_transport->encoded_outgoing, 2048);
100+
101+ /* The message was not actually sent but it needs to be removed
102+ * from the outgoing queue
103+ */
104+ _dbus_connection_message_sent_unlocked (transport->connection,
105+ message);
106+ }
107 else
108 {
109 _dbus_verbose ("Error writing to remote app: %s\n",
110--
111cgit v0.10.2
112
diff --git a/recipes-core/util-linux/util-linux/avoid_parallel_tests.patch b/recipes-core/util-linux/util-linux/avoid_parallel_tests.patch
new file mode 100644
index 0000000..9f6a720
--- /dev/null
+++ b/recipes-core/util-linux/util-linux/avoid_parallel_tests.patch
@@ -0,0 +1,19 @@
1ptest needs buildtest-TESTS and runtest-TESTS targets.
2serial-tests is required to generate those targets.
3
4Signed-off-by: Alexandra Safta <alexandra.safta@enea.com>
5Signed-off-by: Tudor Florea <tudor.florea@enea.com>
6Upstream-Status: Inapporpriate
7
8diff -ruN a/configure.ac b/configure.ac
9--- a/configure.ac 2014-05-27 12:37:42.119772658 +0200
10+++ b/configure.ac 2014-05-27 12:41:46.225573272 +0200
11@@ -10,7 +10,7 @@
12 dnl AC_USE_SYSTEM_EXTENSIONS must be called before any macros that run
13 dnl the compiler (like AC_PROG_LIBTOOL) to avoid autoconf errors.
14 AC_USE_SYSTEM_EXTENSIONS
15-AM_INIT_AUTOMAKE([-Wall foreign 1.10 tar-pax dist-bzip2 no-dist-gzip dist-xz -Wno-portability subdir-objects])
16+AM_INIT_AUTOMAKE([-Wall foreign 1.10 tar-pax dist-bzip2 no-dist-gzip dist-xz -Wno-portability subdir-objects serial-tests])
17
18 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
19 [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
diff --git a/recipes-core/util-linux/util-linux/avoid_unsupported_find_opts.patch b/recipes-core/util-linux/util-linux/avoid_unsupported_find_opts.patch
new file mode 100644
index 0000000..13dc7dd
--- /dev/null
+++ b/recipes-core/util-linux/util-linux/avoid_unsupported_find_opts.patch
@@ -0,0 +1,38 @@
1Avoid unsupported find options
2
3Signed-off-by: Tudor Florea <tudor.florea@enea.com>
4Upstream-Status: Pending
5
6diff -ruN a/tests/run.sh b/tests/run.sh
7--- a/tests/run.sh 2013-08-26 23:48:48.868279097 +0200
8+++ b/tests/run.sh 2013-08-27 00:14:35.646730004 +0200
9@@ -91,7 +91,7 @@
10 # selected tests only
11 for s in $SUBTESTS; do
12 if [ -d "$top_srcdir/tests/ts/$s" ]; then
13- co=$(find $top_srcdir/tests/ts/$s -type f -perm /a+x -regex ".*/[^\.~]*" | sort)
14+ co=$(find $top_srcdir/tests/ts/$s -type f -perm -111 -regex ".*/[^\.~]*" | sort)
15 comps="$comps $co"
16 else
17 echo "Unknown test component '$s'"
18@@ -104,7 +104,7 @@
19 exit 1
20 fi
21
22- comps=$(find $top_srcdir/tests/ts/ -type f -perm /a+x -regex ".*/[^\.~]*" | sort)
23+ comps=$(find $top_srcdir/tests/ts/ -type f -perm -111 -regex ".*/[^\.~]*" | sort)
24 fi
25
26
27diff -ruN a/tests/ts/build-sys/config b/tests/ts/build-sys/config
28--- a/tests/ts/build-sys/config 2013-08-26 23:50:26.800131581 +0200
29+++ b/tests/ts/build-sys/config 2013-08-27 00:10:02.806302850 +0200
30@@ -32,7 +32,7 @@
31 ./configure $opts &> /dev/null
32 make -j &> /dev/null
33
34- bins=$(find . -type f -perm /a+x | sort)
35+ bins=$(find . -type f -perm -111 | sort)
36 for b in $bins; do
37 libs=$(readelf --dynamic $b 2> /dev/null | \
38 awk '/NEEDED/ { print $5 }' | \
diff --git a/recipes-core/util-linux/util-linux/avoid_unsupported_grep_opts.patch b/recipes-core/util-linux/util-linux/avoid_unsupported_grep_opts.patch
new file mode 100644
index 0000000..a0d5efa
--- /dev/null
+++ b/recipes-core/util-linux/util-linux/avoid_unsupported_grep_opts.patch
@@ -0,0 +1,57 @@
1Avoid unsupported grep options
2
3Signed-off-by: Tudor Florea <tudor.florea@enea.com>
4Upstream-Status: Pending
5
6diff -ruN a/ts/ipcs/headers b/ts/ipcs/headers
7--- a/tests/ts/ipcs/headers 2013-09-04 11:03:36.118613250 +0200
8+++ b/teste/ts/ipcs/headers 2013-09-04 11:03:27.906958437 +0200
9@@ -22,35 +22,35 @@
10 ts_init "$*"
11
12 ts_log "test: shm headers"
13-$TS_CMD_IPCS -m -t | grep --after-context=1 "^---" >> $TS_OUTPUT
14-$TS_CMD_IPCS -m -p | grep --after-context=1 "^---" >> $TS_OUTPUT
15-$TS_CMD_IPCS -m -c | grep --after-context=1 "^---" >> $TS_OUTPUT
16+$TS_CMD_IPCS -m -t | grep -A 1 "^---" >> $TS_OUTPUT
17+$TS_CMD_IPCS -m -p | grep -A 1 "^---" >> $TS_OUTPUT
18+$TS_CMD_IPCS -m -c | grep -A 1 "^---" >> $TS_OUTPUT
19 $TS_CMD_IPCS -m -l | grep "^---" >> $TS_OUTPUT
20 $TS_CMD_IPCS -m -u | grep "^---" >> $TS_OUTPUT
21 echo >> $TS_OUTPUT
22
23 ts_log "test: mesg headers"
24-$TS_CMD_IPCS -q -t | grep --after-context=1 "^---" >> $TS_OUTPUT
25-$TS_CMD_IPCS -q -p | grep --after-context=1 "^---" >> $TS_OUTPUT
26-$TS_CMD_IPCS -q -c | grep --after-context=1 "^---" >> $TS_OUTPUT
27+$TS_CMD_IPCS -q -t | grep -A 1 "^---" >> $TS_OUTPUT
28+$TS_CMD_IPCS -q -p | grep -A 1 "^---" >> $TS_OUTPUT
29+$TS_CMD_IPCS -q -c | grep -A 1 "^---" >> $TS_OUTPUT
30 $TS_CMD_IPCS -q -l | grep "^---" >> $TS_OUTPUT
31 $TS_CMD_IPCS -q -u | grep "^---" >> $TS_OUTPUT
32 echo >> $TS_OUTPUT
33
34 ts_log "test: sem headers"
35-$TS_CMD_IPCS -s -t | grep --after-context=1 "^---" >> $TS_OUTPUT
36-$TS_CMD_IPCS -s -p | grep --after-context=1 "^---" >> $TS_OUTPUT
37-$TS_CMD_IPCS -s -c | grep --after-context=1 "^---" >> $TS_OUTPUT
38+$TS_CMD_IPCS -s -t | grep -A 1 "^---" >> $TS_OUTPUT
39+$TS_CMD_IPCS -s -p | grep -A 1 "^---" >> $TS_OUTPUT
40+$TS_CMD_IPCS -s -c | grep -A 1 "^---" >> $TS_OUTPUT
41 $TS_CMD_IPCS -s -l | grep "^---" >> $TS_OUTPUT
42 $TS_CMD_IPCS -s -u | grep "^---" >> $TS_OUTPUT
43 echo >> $TS_OUTPUT
44
45 ts_log "test: all headers"
46-$TS_CMD_IPCS -a | grep --after-context=1 "^---" >> $TS_OUTPUT
47+$TS_CMD_IPCS -a | grep -A 1 "^---" >> $TS_OUTPUT
48
49-$TS_CMD_IPCS -a -t | grep --after-context=1 "^---" >> $TS_OUTPUT
50-$TS_CMD_IPCS -a -p | grep --after-context=1 "^---" >> $TS_OUTPUT
51-$TS_CMD_IPCS -a -c | grep --after-context=1 "^---" >> $TS_OUTPUT
52+$TS_CMD_IPCS -a -t | grep -A 1 "^---" >> $TS_OUTPUT
53+$TS_CMD_IPCS -a -p | grep -A 1 "^---" >> $TS_OUTPUT
54+$TS_CMD_IPCS -a -c | grep -A 1 "^---" >> $TS_OUTPUT
55 $TS_CMD_IPCS -a -l | grep "^---" >> $TS_OUTPUT
56 $TS_CMD_IPCS -a -u | grep "^---" >> $TS_OUTPUT
57
diff --git a/recipes-core/util-linux/util-linux/avoid_unsupported_sleep_param.patch b/recipes-core/util-linux/util-linux/avoid_unsupported_sleep_param.patch
new file mode 100644
index 0000000..3a62067
--- /dev/null
+++ b/recipes-core/util-linux/util-linux/avoid_unsupported_sleep_param.patch
@@ -0,0 +1,20 @@
1Avoid unsupported sleep parameter
2
3Signed-off-by: Tudor Florea <tudor.florea@enea.com>
4Upstream-Status: Pending
5
6diff -ruN a/simple b/simple
7--- a/tests/ts/tailf/simple 2013-09-04 11:34:49.971817130 +0200
8+++ b/tests/ts/tailf/simple 2013-09-04 11:34:37.876325128 +0200
9@@ -25,9 +25,9 @@
10
11 $TS_CMD_TAILF $INPUT > $TS_OUTPUT 2>&1 &
12
13-sleep 0.1
14+sleep 1
15 echo {0..9} >> $INPUT
16-sleep 0.1
17+sleep 1
18
19 rm -f $INPUT
20
diff --git a/recipes-core/util-linux/util-linux/display_testname_for_subtest.patch b/recipes-core/util-linux/util-linux/display_testname_for_subtest.patch
new file mode 100644
index 0000000..64f02d5
--- /dev/null
+++ b/recipes-core/util-linux/util-linux/display_testname_for_subtest.patch
@@ -0,0 +1,17 @@
1Display testname for subtest
2
3Signed-off-by: Tudor Florea <tudor.florea@enea.com>
4Upstream-Status: Pending
5
6diff -ruN a/functions.sh b/functions.sh
7--- a/tests/functions.sh 2013-09-04 12:41:07.625488953 +0200
8+++ b/tests/functions.sh 2013-09-04 17:33:02.402802957 +0200
9@@ -209,7 +209,7 @@
10 [ $TS_NSUBTESTS -eq 0 ] && echo
11 TS_NSUBTESTS=$(( $TS_NSUBTESTS + 1 ))
12
13- printf "%16s: %-27s ..." "" "$TS_SUBNAME"
14+ printf "%13s: %-30s ..." "$TS_COMPONENT" "$TS_SUBNAME"
15 }
16
17 function ts_init {
diff --git a/recipes-core/util-linux/util-linux/ptest.patch b/recipes-core/util-linux/util-linux/ptest.patch
new file mode 100644
index 0000000..e9adc90
--- /dev/null
+++ b/recipes-core/util-linux/util-linux/ptest.patch
@@ -0,0 +1,16 @@
1Define TESTS variable
2
3Signed-off-by: Tudor Florea <tudor.florea@enea.com>
4Upstream-Status: Pending
5
6diff -ruN a/Makefile.am b/Makefile.am
7--- a/Makefile.am 2013-08-26 16:29:42.151429221 +0200
8+++ b/Makefile.am 2013-08-26 17:52:31.013898120 +0200
9@@ -43,7 +43,7 @@
10 dist_usrbin_exec_SCRIPTS =
11 systemdsystemunit_DATA =
12 check_PROGRAMS =
13-TESTS =
14+TESTS = $(check_PROGRAMS)
15
16 PATHFILES =
diff --git a/recipes-core/util-linux/util-linux/run-ptest b/recipes-core/util-linux/util-linux/run-ptest
new file mode 100644
index 0000000..b04f14a
--- /dev/null
+++ b/recipes-core/util-linux/util-linux/run-ptest
@@ -0,0 +1,10 @@
1#!/bin/sh
2
3cd tests || exit 1
4sh ./run.sh 2>&1 | {
5 sed '{
6 s/^\(.*\):\(.*\) \.\.\. OK$/PASS: \1:\2/
7 s/^\(.*\):\(.*\) \.\.\. FAILED \(.*\)$/FAIL: \1:\2 \3/
8 s/^\(.*\):\(.*\) \.\.\. IGNORE \(.*\)$/SKIP: \1:\2 \3/
9 }'
10}
diff --git a/recipes-core/util-linux/util-linux_%.bbappend b/recipes-core/util-linux/util-linux_%.bbappend
new file mode 100644
index 0000000..c5f09ba
--- /dev/null
+++ b/recipes-core/util-linux/util-linux_%.bbappend
@@ -0,0 +1,41 @@
1FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
2
3inherit ptest
4
5SRC_URI += " \
6 file://ptest.patch \
7 file://run-ptest \
8 file://avoid_unsupported_find_opts.patch \
9 file://avoid_unsupported_grep_opts.patch \
10 file://avoid_unsupported_sleep_param.patch \
11 file://display_testname_for_subtest.patch \
12 file://avoid_parallel_tests.patch \
13 "
14
15RDEPENDS_${PN}-ptest += " bash"
16
17do_compile_ptest() {
18 oe_runmake buildtest-TESTS
19}
20
21do_install_ptest() {
22 mkdir -p ${D}${PTEST_PATH}/tests/ts
23 find . -maxdepth 1 -type f -perm -111 -exec cp {} ${D}${PTEST_PATH} \;
24 cp ${S}/tests/functions.sh ${D}${PTEST_PATH}/tests/
25 cp ${S}/tests/commands.sh ${D}${PTEST_PATH}/tests/
26 cp ${S}/tests/run.sh ${D}${PTEST_PATH}/tests/
27 cp -pR ${S}/tests/expected ${D}${PTEST_PATH}/tests/expected
28
29 list="bitops build-sys cal col colrm column dmesg fsck hexdump hwclock ipcs isosize login look lscpu md5 misc more namei paths schedutils script swapon tailf utmpdump"
30 # The following tests are not installed yet:
31 # blkid scsi_debug module dependent
32 # cramfs gcc dependent
33 # eject gcc dependent
34 # fdisk scsi_debug module and gcc dependent
35 # libmount uuidgen dependent
36 # mount gcc dependant
37 # partx blkid dependant
38 for d in $list; do
39 cp -pR ${S}/tests/ts/$d ${D}${PTEST_PATH}/tests/ts/
40 done
41}