From bdcde818b9a2cff5c49f372de18b5bf6d4416e7e Mon Sep 17 00:00:00 2001 From: Tavi Date: Sun, 15 Sep 2024 16:56:21 -0400 Subject: [PATCH] 15.1: September 2024 ASB work Signed-off-by: Tavi --- Logs/resetWorkspace-LineageOS-15.1.txt | 2 +- ...arser-parameter-to-XML_UseForeignDTD.patch | 4 +- ...ion-hint-on-XML_ERROR_INVALID_ARGUME.patch | 2 +- ...parser-parameter-for-XML_ParseBuffer.patch | 2 +- ...ect-negative-len-for-XML_ParseBuffer.patch | 2 +- ...b-Detect-integer-overflow-in-dtdCopy.patch | 4 +- ...er-overflow-in-function-nextScaffold.patch | 4 +- ...-opening-tag-bindings-after-closing-.patch | 6 +- .../401373-backport.patch | 66 +++ .../401375-backport.patch | 28 + .../401377-backport.patch | 114 ++++ .../401380-backport.patch | 537 ++++++++++++++++++ .../android_system_bt/399772-backport.patch | 2 +- Scripts/LineageOS-15.1/Patch.sh | 6 +- 14 files changed, 764 insertions(+), 15 deletions(-) create mode 100644 Patches/LineageOS-15.1/android_frameworks_base/401373-backport.patch create mode 100644 Patches/LineageOS-15.1/android_packages_apps_Settings/401375-backport.patch create mode 100644 Patches/LineageOS-15.1/android_packages_apps_Settings/401377-backport.patch create mode 100644 Patches/LineageOS-15.1/android_packages_services_Telecomm/401380-backport.patch diff --git a/Logs/resetWorkspace-LineageOS-15.1.txt b/Logs/resetWorkspace-LineageOS-15.1.txt index 938d20fa..efbdf374 100644 --- a/Logs/resetWorkspace-LineageOS-15.1.txt +++ b/Logs/resetWorkspace-LineageOS-15.1.txt @@ -68,7 +68,7 @@ external/caliper 4a0d9aba0856d0aa965d5653bfa4c138f0e8a8ba external/cblas d063db8bdddfcde61e4bad3bfe65941fd73e8094 external/chromium-libpac 0ac78251d11006d764ba1aad8cc0867827fafe5c external/chromium-trace 8b2c0074e71a8086dee98ca8730acfdc5eddf7a1 -external/chromium-webview b270aa98312408d5893ee72fcd62b4d89937ceb2 +external/chromium-webview 8400ae9b819741cd4d436cce372496426ec85fc9 external/clang 751a76679b0fb5798ea6cab75906df07edcab315 external/cmockery 9199c7bfafefea32d1884182fa655b6e4578c1c4 external/compiler-rt 0c46c9e892a3f68420635032ef2f6152dabd197c diff --git a/Patches/LineageOS-15.1/android_external_expat/0001-Validate-parser-parameter-to-XML_UseForeignDTD.patch b/Patches/LineageOS-15.1/android_external_expat/0001-Validate-parser-parameter-to-XML_UseForeignDTD.patch index e5dd60d1..61303d5d 100644 --- a/Patches/LineageOS-15.1/android_external_expat/0001-Validate-parser-parameter-to-XML_UseForeignDTD.patch +++ b/Patches/LineageOS-15.1/android_external_expat/0001-Validate-parser-parameter-to-XML_UseForeignDTD.patch @@ -9,7 +9,7 @@ Subject: [PATCH] Validate parser parameter to XML_UseForeignDTD. 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/expat.h b/lib/expat.h -index ec62f140..145c283b 100644 +index 086e24b3..957da1c5 100644 --- a/lib/expat.h +++ b/lib/expat.h @@ -95,7 +95,9 @@ enum XML_Error { @@ -32,7 +32,7 @@ index ec62f140..145c283b 100644 XMLPARSEAPI(enum XML_Error) XML_UseForeignDTD(XML_Parser parser, XML_Bool useDTD); diff --git a/lib/xmlparse.c b/lib/xmlparse.c -index 57c93e05..9df42782 100644 +index ee71adad..065b04f8 100644 --- a/lib/xmlparse.c +++ b/lib/xmlparse.c @@ -1243,6 +1243,8 @@ XML_UseParserAsHandlerArg(XML_Parser parser) diff --git a/Patches/LineageOS-15.1/android_external_expat/0002-expat.h-Fix-version-hint-on-XML_ERROR_INVALID_ARGUME.patch b/Patches/LineageOS-15.1/android_external_expat/0002-expat.h-Fix-version-hint-on-XML_ERROR_INVALID_ARGUME.patch index d45176e9..89b21bbe 100644 --- a/Patches/LineageOS-15.1/android_external_expat/0002-expat.h-Fix-version-hint-on-XML_ERROR_INVALID_ARGUME.patch +++ b/Patches/LineageOS-15.1/android_external_expat/0002-expat.h-Fix-version-hint-on-XML_ERROR_INVALID_ARGUME.patch @@ -9,7 +9,7 @@ Introduced at commit 768613f801020dee30a0583ec6cd77ec401d747f. 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/expat.h b/lib/expat.h -index 145c283b..59c36e54 100644 +index 957da1c5..34644468 100644 --- a/lib/expat.h +++ b/lib/expat.h @@ -96,7 +96,7 @@ enum XML_Error { diff --git a/Patches/LineageOS-15.1/android_external_expat/0003-Validate-parser-parameter-for-XML_ParseBuffer.patch b/Patches/LineageOS-15.1/android_external_expat/0003-Validate-parser-parameter-for-XML_ParseBuffer.patch index 733f957d..1a71b030 100644 --- a/Patches/LineageOS-15.1/android_external_expat/0003-Validate-parser-parameter-for-XML_ParseBuffer.patch +++ b/Patches/LineageOS-15.1/android_external_expat/0003-Validate-parser-parameter-for-XML_ParseBuffer.patch @@ -8,7 +8,7 @@ Subject: [PATCH] Validate parser parameter for XML_ParseBuffer 1 file changed, 2 insertions(+) diff --git a/lib/xmlparse.c b/lib/xmlparse.c -index 9df42782..d3b43171 100644 +index 065b04f8..f35645f3 100644 --- a/lib/xmlparse.c +++ b/lib/xmlparse.c @@ -1670,6 +1670,8 @@ XML_ParseBuffer(XML_Parser parser, int len, int isFinal) diff --git a/Patches/LineageOS-15.1/android_external_expat/0004-lib-Reject-negative-len-for-XML_ParseBuffer.patch b/Patches/LineageOS-15.1/android_external_expat/0004-lib-Reject-negative-len-for-XML_ParseBuffer.patch index 4dca3603..79a2a904 100644 --- a/Patches/LineageOS-15.1/android_external_expat/0004-lib-Reject-negative-len-for-XML_ParseBuffer.patch +++ b/Patches/LineageOS-15.1/android_external_expat/0004-lib-Reject-negative-len-for-XML_ParseBuffer.patch @@ -13,7 +13,7 @@ Change-Id: Ic070b629e085c2aa5fd2711e1738acde42fee444 1 file changed, 6 insertions(+) diff --git a/lib/xmlparse.c b/lib/xmlparse.c -index d3b43171..d9f33395 100644 +index f35645f3..bd429812 100644 --- a/lib/xmlparse.c +++ b/lib/xmlparse.c @@ -1672,6 +1672,12 @@ XML_ParseBuffer(XML_Parser parser, int len, int isFinal) diff --git a/Patches/LineageOS-15.1/android_external_expat/0005-lib-Detect-integer-overflow-in-dtdCopy.patch b/Patches/LineageOS-15.1/android_external_expat/0005-lib-Detect-integer-overflow-in-dtdCopy.patch index 19f52a31..602cb668 100644 --- a/Patches/LineageOS-15.1/android_external_expat/0005-lib-Detect-integer-overflow-in-dtdCopy.patch +++ b/Patches/LineageOS-15.1/android_external_expat/0005-lib-Detect-integer-overflow-in-dtdCopy.patch @@ -13,10 +13,10 @@ Change-Id: Ie0e4d640a83b06d9829c742e73af3aa40116e10b 1 file changed, 10 insertions(+) diff --git a/lib/xmlparse.c b/lib/xmlparse.c -index d9f33395..99bf2411 100644 +index bd429812..c88eaeb3 100644 --- a/lib/xmlparse.c +++ b/lib/xmlparse.c -@@ -6004,6 +6004,16 @@ dtdCopy(XML_Parser oldParser, DTD *newDtd, const DTD *oldDtd, const XML_Memory_H +@@ -6008,6 +6008,16 @@ dtdCopy(XML_Parser oldParser, DTD *newDtd, const DTD *oldDtd, const XML_Memory_H if (!newE) return 0; if (oldE->nDefaultAtts) { diff --git a/Patches/LineageOS-15.1/android_external_expat/0006-lib-Detect-integer-overflow-in-function-nextScaffold.patch b/Patches/LineageOS-15.1/android_external_expat/0006-lib-Detect-integer-overflow-in-function-nextScaffold.patch index 1b3c7a0b..a130f676 100644 --- a/Patches/LineageOS-15.1/android_external_expat/0006-lib-Detect-integer-overflow-in-function-nextScaffold.patch +++ b/Patches/LineageOS-15.1/android_external_expat/0006-lib-Detect-integer-overflow-in-function-nextScaffold.patch @@ -13,10 +13,10 @@ Change-Id: Ic152fd5352442dc60db0358226118a0ad3021bc5 1 file changed, 9 insertions(+) diff --git a/lib/xmlparse.c b/lib/xmlparse.c -index 99bf2411..977079f9 100644 +index c88eaeb3..e93a788d 100644 --- a/lib/xmlparse.c +++ b/lib/xmlparse.c -@@ -6494,6 +6494,15 @@ nextScaffoldPart(XML_Parser parser) +@@ -6498,6 +6498,15 @@ nextScaffoldPart(XML_Parser parser) int next; if (!dtd->scaffIndex) { diff --git a/Patches/LineageOS-15.1/android_external_expat/0007-lib-Stop-leaking-opening-tag-bindings-after-closing-.patch b/Patches/LineageOS-15.1/android_external_expat/0007-lib-Stop-leaking-opening-tag-bindings-after-closing-.patch index b6832b2e..fc82fd47 100644 --- a/Patches/LineageOS-15.1/android_external_expat/0007-lib-Stop-leaking-opening-tag-bindings-after-closing-.patch +++ b/Patches/LineageOS-15.1/android_external_expat/0007-lib-Stop-leaking-opening-tag-bindings-after-closing-.patch @@ -15,10 +15,10 @@ Change-Id: I2572abf87973e8de97898726812a14354aa01c17 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/xmlparse.c b/lib/xmlparse.c -index 977079f9..cc30f71f 100644 +index e93a788d..300f4e0b 100644 --- a/lib/xmlparse.c +++ b/lib/xmlparse.c -@@ -2567,9 +2567,6 @@ doContent(XML_Parser parser, +@@ -2571,9 +2571,6 @@ doContent(XML_Parser parser, int len; const char *rawName; TAG *tag = tagStack; @@ -28,7 +28,7 @@ index 977079f9..cc30f71f 100644 rawName = s + enc->minBytesPerChar*2; len = XmlNameLength(enc, rawName); if (len != tag->rawNameLength -@@ -2577,6 +2574,9 @@ doContent(XML_Parser parser, +@@ -2581,6 +2578,9 @@ doContent(XML_Parser parser, *eventPP = rawName; return XML_ERROR_TAG_MISMATCH; } diff --git a/Patches/LineageOS-15.1/android_frameworks_base/401373-backport.patch b/Patches/LineageOS-15.1/android_frameworks_base/401373-backport.patch new file mode 100644 index 00000000..6242a975 --- /dev/null +++ b/Patches/LineageOS-15.1/android_frameworks_base/401373-backport.patch @@ -0,0 +1,66 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Kiran Ramachandra +Date: Wed, 5 Jun 2024 21:03:33 +0000 +Subject: [PATCH] DO NOT MERGE Ignore - Sanitized uri scheme by removing scheme + delimiter + +Initially considered removing unsupported characters as per IANA guidelines, but this could break applications that use custom schemes with asterisks. Instead, opted to remove only the "://" to minimize disruption + +Bug: 261721900 +Test: atest FrameworksCoreTests:android.net.UriTest + +No-Typo-Check: The unit test is specifically written to test few cases, string "http://https://" is not a typo +(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:1fd0421801c391dd619cafeeea8d379a9029074a) +Merged-In: I88b1550a5d8b3dc0f6286e28899884025d059645 +Change-Id: I88b1550a5d8b3dc0f6286e28899884025d059645 +--- + core/java/android/net/Uri.java | 6 +++++- + core/tests/coretests/src/android/net/UriTest.java | 11 +++++++++++ + 2 files changed, 16 insertions(+), 1 deletion(-) + +diff --git a/core/java/android/net/Uri.java b/core/java/android/net/Uri.java +index 8af3687af40b..757ee29499fe 100644 +--- a/core/java/android/net/Uri.java ++++ b/core/java/android/net/Uri.java +@@ -1351,7 +1351,11 @@ public abstract class Uri implements Parcelable, Comparable { + * @param scheme name or {@code null} if this is a relative Uri + */ + public Builder scheme(String scheme) { +- this.scheme = scheme; ++ if (scheme != null) { ++ this.scheme = scheme.replace("://", ""); ++ } else { ++ this.scheme = null; ++ } + return this; + } + +diff --git a/core/tests/coretests/src/android/net/UriTest.java b/core/tests/coretests/src/android/net/UriTest.java +index ea0347d67ad7..6c9fdd5a83a7 100644 +--- a/core/tests/coretests/src/android/net/UriTest.java ++++ b/core/tests/coretests/src/android/net/UriTest.java +@@ -18,6 +18,7 @@ package android.net; + + import android.content.ContentUris; + import android.os.Parcel; ++import android.platform.test.annotations.AsbSecurityTest; + import android.test.suitebuilder.annotation.SmallTest; + + import junit.framework.TestCase; +@@ -83,6 +84,16 @@ public class UriTest extends TestCase { + assertNull(u.getHost()); + } + ++ @AsbSecurityTest(cveBugId = 261721900) ++ @SmallTest ++ public void testSchemeSanitization() { ++ Uri uri = new Uri.Builder() ++ .scheme("http://https://evil.com:/te:st/") ++ .authority("google.com").path("one/way").build(); ++ assertEquals("httphttpsevil.com:/te:st/", uri.getScheme()); ++ assertEquals("httphttpsevil.com:/te:st/://google.com/one/way", uri.toString()); ++ } ++ + @SmallTest + public void testStringUri() { + assertEquals("bob lee", diff --git a/Patches/LineageOS-15.1/android_packages_apps_Settings/401375-backport.patch b/Patches/LineageOS-15.1/android_packages_apps_Settings/401375-backport.patch new file mode 100644 index 00000000..e2d36de1 --- /dev/null +++ b/Patches/LineageOS-15.1/android_packages_apps_Settings/401375-backport.patch @@ -0,0 +1,28 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Chaohui Wang +Date: Thu, 2 Nov 2023 11:43:00 +0800 +Subject: [PATCH] Limit wifi item edit content's max length to 500 + +Bug: 293199910 +Test: manual - on "Add network" + +(cherry picked from commit 855053ca4124f2d515b21c469096f8c18bd4829d) +(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:092668676af741719d50ac0f121a8f8461aa21ad) +Merged-In: I303b8c6e0f3c3a1174a047ba98f302042e5db9ae +Change-Id: I303b8c6e0f3c3a1174a047ba98f302042e5db9ae +--- + res/values/styles.xml | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/res/values/styles.xml b/res/values/styles.xml +index f3e16bffcd6..ae3d03fbf91 100644 +--- a/res/values/styles.xml ++++ b/res/values/styles.xml +@@ -218,6 +218,7 @@ + 4dip + 4dip + 18sp ++ 500 + + +