summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-support/icu/icu/0001-Fix-big-endian-build.patch28
-rw-r--r--meta/recipes-support/icu/icu/0001-icu-Added-armeb-support.patch6
-rw-r--r--meta/recipes-support/icu/icu/CVE-2020-10531.patch128
-rw-r--r--meta/recipes-support/icu/icu/icu-pkgdata-large-cmd.patch49
-rw-r--r--meta/recipes-support/icu/icu_67.1.bb (renamed from meta/recipes-support/icu/icu_66.1.bb)8
5 files changed, 5 insertions, 214 deletions
diff --git a/meta/recipes-support/icu/icu/0001-Fix-big-endian-build.patch b/meta/recipes-support/icu/icu/0001-Fix-big-endian-build.patch
deleted file mode 100644
index 91d68848c7..0000000000
--- a/meta/recipes-support/icu/icu/0001-Fix-big-endian-build.patch
+++ /dev/null
@@ -1,28 +0,0 @@
1From 9be0b489a94b57419202c552022f25cb95bfac51 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Wed, 17 Apr 2019 16:41:58 +0200
4Subject: [PATCH] Fix big-endian build
5
6Bug-report: https://unicode-org.atlassian.net/browse/ICU-20533
7Patch taken from: https://bugs.gentoo.org/682170
8
9it is applied upstream and will be in version 67+
10
11Upstream-Status: Backport [https://github.com/unicode-org/icu/commit/4a3a457b38cd828b7b3fa4fdbc6e2504a57275e9]
12Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
13---
14 data/Makefile.in | 3 ++-
15 1 file changed, 2 insertions(+), 1 deletion(-)
16
17--- a/data/Makefile.in
18+++ b/data/Makefile.in
19@@ -148,7 +148,8 @@ ICUDATA_ARCHIVE = $(firstword $(wildcard
20 # and convert it to the current type.
21 ifneq ($(ICUDATA_ARCHIVE),)
22 ICUDATA_SOURCE_ARCHIVE = $(OUTDIR)/$(ICUDATA_PLATFORM_NAME).dat
23-$(ICUDATA_SOURCE_ARCHIVE): $(ICUDATA_ARCHIVE) $(OUTDIR)
24+$(ICUDATA_SOURCE_ARCHIVE): $(ICUDATA_ARCHIVE)
25+ $(MKINSTALLDIRS) $(OUTDIR)
26 $(INVOKE) $(TOOLBINDIR)/icupkg -t$(ICUDATA_CHAR) $(ICUDATA_ARCHIVE) $(ICUDATA_SOURCE_ARCHIVE)
27 endif
28 else
diff --git a/meta/recipes-support/icu/icu/0001-icu-Added-armeb-support.patch b/meta/recipes-support/icu/icu/0001-icu-Added-armeb-support.patch
index 299689d95c..145efc0e01 100644
--- a/meta/recipes-support/icu/icu/0001-icu-Added-armeb-support.patch
+++ b/meta/recipes-support/icu/icu/0001-icu-Added-armeb-support.patch
@@ -13,10 +13,10 @@ Signed-off-by: Lei Maohui <leimaohui@cn.fujitsu.com>
13 1 file changed, 1 insertion(+), 1 deletion(-) 13 1 file changed, 1 insertion(+), 1 deletion(-)
14 14
15diff --git a/i18n/double-conversion-utils.h b/i18n/double-conversion-utils.h 15diff --git a/i18n/double-conversion-utils.h b/i18n/double-conversion-utils.h
16index 1e44fca..e4f2a8b 100644 16index 8c6a0e1..cf89907 100644
17--- a/i18n/double-conversion-utils.h 17--- a/i18n/double-conversion-utils.h
18+++ b/i18n/double-conversion-utils.h 18+++ b/i18n/double-conversion-utils.h
19@@ -92,7 +92,7 @@ int main(int argc, char** argv) { 19@@ -115,7 +115,7 @@ int main(int argc, char** argv) {
20 // 20 //
21 // If it prints "correct" then the architecture should be here, in the "correct" section. 21 // If it prints "correct" then the architecture should be here, in the "correct" section.
22 #if defined(_M_X64) || defined(__x86_64__) || \ 22 #if defined(_M_X64) || defined(__x86_64__) || \
@@ -24,7 +24,7 @@ index 1e44fca..e4f2a8b 100644
24+ defined(__arm__) || defined(__avr32__) || defined(_M_ARM) || defined(_M_ARM64) || \ 24+ defined(__arm__) || defined(__avr32__) || defined(_M_ARM) || defined(_M_ARM64) || \
25 defined(__hppa__) || defined(__ia64__) || \ 25 defined(__hppa__) || defined(__ia64__) || \
26 defined(__mips__) || \ 26 defined(__mips__) || \
27 defined(__powerpc__) || defined(__ppc__) || defined(__ppc64__) || \ 27 defined(__nios2__) || \
28-- 28--
292.7.4 292.7.4
30 30
diff --git a/meta/recipes-support/icu/icu/CVE-2020-10531.patch b/meta/recipes-support/icu/icu/CVE-2020-10531.patch
deleted file mode 100644
index 6697b27dc8..0000000000
--- a/meta/recipes-support/icu/icu/CVE-2020-10531.patch
+++ /dev/null
@@ -1,128 +0,0 @@
1From b7d08bc04a4296982fcef8b6b8a354a9e4e7afca Mon Sep 17 00:00:00 2001
2From: Frank Tang <ftang@chromium.org>
3Date: Sat, 1 Feb 2020 02:39:04 +0000
4Subject: [PATCH] ICU-20958 Prevent SEGV_MAPERR in append
5
6See #971
7
8Upstream-Status: Accepted
9CVE: CVE-2020-10531
10
11Reference to upstream patch:
12https://github.com/unicode-org/icu/commit/b7d08bc04a4296982fcef8b6b8a354a9e4e7afca
13
14---
15 common/unistr.cpp | 6 ++-
16 test/intltest/ustrtest.cpp | 62 +++++++++++++++++++++++++++++++
17 test/intltest/ustrtest.h | 1 +
18 3 files changed, 68 insertions(+), 1 deletion(-)
19
20diff --git a/common/unistr.cpp b/common/unistr.cpp
21index 901bb33..6ea0915 100644
22--- a/common/unistr.cpp
23+++ b/common/unistr.cpp
24@@ -1563,7 +1563,11 @@ UnicodeString::doAppend(const UChar *srcChars, int32_t srcStart, int32_t srcLeng
25 }
26
27 int32_t oldLength = length();
28- int32_t newLength = oldLength + srcLength;
29+ int32_t newLength;
30+ if (uprv_add32_overflow(oldLength, srcLength, &newLength)) {
31+ setToBogus();
32+ return *this;
33+ }
34
35 // Check for append onto ourself
36 const UChar* oldArray = getArrayStart();
37diff --git a/test/intltest/ustrtest.cpp b/test/intltest/ustrtest.cpp
38index b6515ea..ad38bdf 100644
39--- a/test/intltest/ustrtest.cpp
40+++ b/test/intltest/ustrtest.cpp
41@@ -67,6 +67,7 @@ void UnicodeStringTest::runIndexedTest( int32_t index, UBool exec, const char* &
42 TESTCASE_AUTO(TestWCharPointers);
43 TESTCASE_AUTO(TestNullPointers);
44 TESTCASE_AUTO(TestUnicodeStringInsertAppendToSelf);
45+ TESTCASE_AUTO(TestLargeAppend);
46 TESTCASE_AUTO_END;
47 }
48
49@@ -2310,3 +2311,64 @@ void UnicodeStringTest::TestUnicodeStringInsertAppendToSelf() {
50 str.insert(2, sub);
51 assertEquals("", u"abbcdcde", str);
52 }
53+
54+void UnicodeStringTest::TestLargeAppend() {
55+ if(quick) return;
56+
57+ IcuTestErrorCode status(*this, "TestLargeAppend");
58+ // Make a large UnicodeString
59+ int32_t len = 0xAFFFFFF;
60+ UnicodeString str;
61+ char16_t *buf = str.getBuffer(len);
62+ // A fast way to set buffer to valid Unicode.
63+ // 4E4E is a valid unicode character
64+ uprv_memset(buf, 0x4e, len * 2);
65+ str.releaseBuffer(len);
66+ UnicodeString dest;
67+ // Append it 16 times
68+ // 0xAFFFFFF times 16 is 0xA4FFFFF1,
69+ // which is greater than INT32_MAX, which is 0x7FFFFFFF.
70+ int64_t total = 0;
71+ for (int32_t i = 0; i < 16; i++) {
72+ dest.append(str);
73+ total += len;
74+ if (total <= INT32_MAX) {
75+ assertFalse("dest is not bogus", dest.isBogus());
76+ } else {
77+ assertTrue("dest should be bogus", dest.isBogus());
78+ }
79+ }
80+ dest.remove();
81+ total = 0;
82+ for (int32_t i = 0; i < 16; i++) {
83+ dest.append(str);
84+ total += len;
85+ if (total + len <= INT32_MAX) {
86+ assertFalse("dest is not bogus", dest.isBogus());
87+ } else if (total <= INT32_MAX) {
88+ // Check that a string of exactly the maximum size works
89+ UnicodeString str2;
90+ int32_t remain = INT32_MAX - total;
91+ char16_t *buf2 = str2.getBuffer(remain);
92+ if (buf2 == nullptr) {
93+ // if somehow memory allocation fail, return the test
94+ return;
95+ }
96+ uprv_memset(buf2, 0x4e, remain * 2);
97+ str2.releaseBuffer(remain);
98+ dest.append(str2);
99+ total += remain;
100+ assertEquals("When a string of exactly the maximum size works", (int64_t)INT32_MAX, total);
101+ assertEquals("When a string of exactly the maximum size works", INT32_MAX, dest.length());
102+ assertFalse("dest is not bogus", dest.isBogus());
103+
104+ // Check that a string size+1 goes bogus
105+ str2.truncate(1);
106+ dest.append(str2);
107+ total++;
108+ assertTrue("dest should be bogus", dest.isBogus());
109+ } else {
110+ assertTrue("dest should be bogus", dest.isBogus());
111+ }
112+ }
113+}
114diff --git a/test/intltest/ustrtest.h b/test/intltest/ustrtest.h
115index 218befd..4a356a9 100644
116--- a/test/intltest/ustrtest.h
117+++ b/test/intltest/ustrtest.h
118@@ -97,6 +97,7 @@ public:
119 void TestWCharPointers();
120 void TestNullPointers();
121 void TestUnicodeStringInsertAppendToSelf();
122+ void TestLargeAppend();
123 };
124
125 #endif
126--
1272.17.1
128
diff --git a/meta/recipes-support/icu/icu/icu-pkgdata-large-cmd.patch b/meta/recipes-support/icu/icu/icu-pkgdata-large-cmd.patch
deleted file mode 100644
index e758a623ef..0000000000
--- a/meta/recipes-support/icu/icu/icu-pkgdata-large-cmd.patch
+++ /dev/null
@@ -1,49 +0,0 @@
1pkgdata.cpp: use LARGE_BUFFER_MAX_SIZE for cmd
2
3Use LARGE_BUFFER_MAX_SIZE for cmd rather than SMALL_BUFFER_MAX_SIZE,
4otherwise there was a Segmentation fault error when the command line is
5long, this should be a misplay since other cmd uses
6LARGE_BUFFER_MAX_SIZE.
7
8Upstream-Status: Pending
9
10Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
11Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
12---
13 tools/pkgdata/pkgdata.cpp | 6 +++---
14 1 file changed, 3 insertions(+), 3 deletions(-)
15
16diff --git a/tools/pkgdata/pkgdata.cpp b/tools/pkgdata/pkgdata.cpp
17index 60167dd..506dd32 100644
18--- a/tools/pkgdata/pkgdata.cpp
19+++ b/tools/pkgdata/pkgdata.cpp
20@@ -1084,7 +1084,7 @@ normal_symlink_mode:
21
22 static int32_t pkg_installLibrary(const char *installDir, const char *targetDir, UBool noVersion) {
23 int32_t result = 0;
24- char cmd[SMALL_BUFFER_MAX_SIZE];
25+ char cmd[LARGE_BUFFER_MAX_SIZE];
26
27 sprintf(cmd, "cd %s && %s %s %s%s%s",
28 targetDir,
29@@ -1152,7 +1152,7 @@ static int32_t pkg_installLibrary(const char *installDir, const char *targetDir,
30
31 static int32_t pkg_installCommonMode(const char *installDir, const char *fileName) {
32 int32_t result = 0;
33- char cmd[SMALL_BUFFER_MAX_SIZE] = "";
34+ char cmd[LARGE_BUFFER_MAX_SIZE] = "";
35
36 if (!T_FileStream_file_exists(installDir)) {
37 UErrorCode status = U_ZERO_ERROR;
38@@ -1184,7 +1184,7 @@ static int32_t pkg_installCommonMode(const char *installDir, const char *fileNam
39 #endif
40 static int32_t pkg_installFileMode(const char *installDir, const char *srcDir, const char *fileListName) {
41 int32_t result = 0;
42- char cmd[SMALL_BUFFER_MAX_SIZE] = "";
43+ char cmd[LARGE_BUFFER_MAX_SIZE] = "";
44
45 if (!T_FileStream_file_exists(installDir)) {
46 UErrorCode status = U_ZERO_ERROR;
47--
481.9.1
49
diff --git a/meta/recipes-support/icu/icu_66.1.bb b/meta/recipes-support/icu/icu_67.1.bb
index a8096c1840..58638507c9 100644
--- a/meta/recipes-support/icu/icu_66.1.bb
+++ b/meta/recipes-support/icu/icu_67.1.bb
@@ -22,18 +22,15 @@ DATA_SRC_URI = "https://github.com/unicode-org/icu/releases/download/release-${I
22SRC_URI = "${BASE_SRC_URI};name=code \ 22SRC_URI = "${BASE_SRC_URI};name=code \
23 ${DATA_SRC_URI};name=data \ 23 ${DATA_SRC_URI};name=data \
24 file://filter.json \ 24 file://filter.json \
25 file://icu-pkgdata-large-cmd.patch \
26 file://fix-install-manx.patch \ 25 file://fix-install-manx.patch \
27 file://0001-Fix-big-endian-build.patch;apply=no \
28 file://0001-icu-Added-armeb-support.patch \ 26 file://0001-icu-Added-armeb-support.patch \
29 file://CVE-2020-10531.patch \
30 " 27 "
31 28
32SRC_URI_append_class-target = "\ 29SRC_URI_append_class-target = "\
33 file://0001-Disable-LDFLAGSICUDT-for-Linux.patch \ 30 file://0001-Disable-LDFLAGSICUDT-for-Linux.patch \
34 " 31 "
35SRC_URI[code.sha256sum] = "52a3f2209ab95559c1cf0a14f24338001f389615bf00e2585ef3dbc43ecf0a2e" 32SRC_URI[code.sha256sum] = "94a80cd6f251a53bd2a997f6f1b5ac6653fe791dfab66e1eb0227740fb86d5dc"
36SRC_URI[data.sha256sum] = "8be647f738891d2beb79d48f99077b3499948430eae6f1be112553b15ab0243e" 33SRC_URI[data.sha256sum] = "7c16a59cc8c06128b7ecc1dc4fc056b36b17349312829b17408b9e67b05c4a7e"
37 34
38UPSTREAM_CHECK_REGEX = "icu4c-(?P<pver>\d+(_\d+)+)-src" 35UPSTREAM_CHECK_REGEX = "icu4c-(?P<pver>\d+(_\d+)+)-src"
39UPSTREAM_CHECK_URI = "https://github.com/unicode-org/icu/releases" 36UPSTREAM_CHECK_URI = "https://github.com/unicode-org/icu/releases"
@@ -44,7 +41,6 @@ do_make_icudata_class-target () {
44 cd ${S} 41 cd ${S}
45 rm -rf data 42 rm -rf data
46 cp -a ${WORKDIR}/data . 43 cp -a ${WORKDIR}/data .
47 patch -p1 < ${WORKDIR}/0001-Fix-big-endian-build.patch
48 AR='${BUILD_AR}' \ 44 AR='${BUILD_AR}' \
49 CC='${BUILD_CC}' \ 45 CC='${BUILD_CC}' \
50 CPP='${BUILD_CPP}' \ 46 CPP='${BUILD_CPP}' \