summaryrefslogtreecommitdiffstats
path: root/dynamic-layers/selinux/android-tools/android-tools/fastboot_dont_use_sparse_file_import_auto_in_load_buf_fd.patch
diff options
context:
space:
mode:
Diffstat (limited to 'dynamic-layers/selinux/android-tools/android-tools/fastboot_dont_use_sparse_file_import_auto_in_load_buf_fd.patch')
-rw-r--r--dynamic-layers/selinux/android-tools/android-tools/fastboot_dont_use_sparse_file_import_auto_in_load_buf_fd.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/dynamic-layers/selinux/android-tools/android-tools/fastboot_dont_use_sparse_file_import_auto_in_load_buf_fd.patch b/dynamic-layers/selinux/android-tools/android-tools/fastboot_dont_use_sparse_file_import_auto_in_load_buf_fd.patch
new file mode 100644
index 0000000..d8c74be
--- /dev/null
+++ b/dynamic-layers/selinux/android-tools/android-tools/fastboot_dont_use_sparse_file_import_auto_in_load_buf_fd.patch
@@ -0,0 +1,42 @@
1upstream commit taken as below
2Original Issue link
3https://android-review.googlesource.com/c/platform/system/core/+/1123485
4
5Commit taken below:
6
7fastboot: don't use sparse_file_import_auto() in load_buf_fd()
8
9load_buf_fd() attempts to find the size of the file that it is about
10to load by first calling sparse_file_import_auto() then using
11sparse_file_len() upon success or falling back to the file size on the
12filesystem on failure.
13
14This is problematic however as sparse_file_import_auto() creates a
15sparse_file out of the normal file, but does not resparse it, so an
16assertion fails during the sparse_file_len() call.
17
18This is fixed by using sparse_file_import() instead. This will fail
19in the case that the file is not sparse and the call to
20sparse_file_len() will be properly skipped.
21
22Bug: 140538105
23Test: flash blueline factory image with assertions enabled in
24 libsparse/sparse.cpp
25
26Change-Id: I0283be33563a3301ce5b09bde41105a20f91086c
27
28https://android.googlesource.com/platform/system/core/+/fbb9535aaea5ae4011f3c3edf4c00b27452f57ec
29Upstream-Status: Backport(commit fbb9535aaea5ae4011f3c3edf4c00b27452f57ec)
30Signed-off-by: Nisha Parrakat <Nisha.Parrakat@kpit.com>
31
32--- git/system/core/fastboot/fastboot.cpp 2021-05-28 09:24:15.583963227 +0000
33+++ git/system/core/fastboot/fastboot.cpp 2021-05-28 09:25:09.948974990 +0000
34@@ -869,7 +869,7 @@
35 return false;
36 }
37
38- if (sparse_file* s = sparse_file_import_auto(fd, false, false)) {
39+ if (sparse_file* s = sparse_file_import(fd, false, false)) {
40 buf->image_size = sparse_file_len(s, false, false);
41 sparse_file_destroy(s);
42 } else {