diff options
Diffstat (limited to 'dynamic-layers/selinux/android-tools/android-tools/core/0005-fastboot-don-t-use-sparse_file_import_auto-in-load_b.patch')
-rw-r--r-- | dynamic-layers/selinux/android-tools/android-tools/core/0005-fastboot-don-t-use-sparse_file_import_auto-in-load_b.patch | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/dynamic-layers/selinux/android-tools/android-tools/core/0005-fastboot-don-t-use-sparse_file_import_auto-in-load_b.patch b/dynamic-layers/selinux/android-tools/android-tools/core/0005-fastboot-don-t-use-sparse_file_import_auto-in-load_b.patch deleted file mode 100644 index d465ad6..0000000 --- a/dynamic-layers/selinux/android-tools/android-tools/core/0005-fastboot-don-t-use-sparse_file_import_auto-in-load_b.patch +++ /dev/null | |||
@@ -1,54 +0,0 @@ | |||
1 | From a4839f29e1286b0c53208a45b9c237d81021f829 Mon Sep 17 00:00:00 2001 | ||
2 | From: Etienne Cordonnier <ecordonnier@snap.com> | ||
3 | Date: Fri, 3 Mar 2023 13:15:47 +0100 | ||
4 | Subject: [PATCH 05/15] fastboot: don't use sparse_file_import_auto() in | ||
5 | load_buf_fd() | ||
6 | |||
7 | upstream commit taken as below Original Issue link https://android-review.googlesource.com/c/platform/system/core/+/1123485 | ||
8 | |||
9 | Commit taken below: | ||
10 | |||
11 | fastboot: don't use sparse_file_import_auto() in load_buf_fd() | ||
12 | |||
13 | load_buf_fd() attempts to find the size of the file that it is about | ||
14 | to load by first calling sparse_file_import_auto() then using | ||
15 | sparse_file_len() upon success or falling back to the file size on the | ||
16 | filesystem on failure. | ||
17 | |||
18 | This is problematic however as sparse_file_import_auto() creates a | ||
19 | sparse_file out of the normal file, but does not resparse it, so an | ||
20 | assertion fails during the sparse_file_len() call. | ||
21 | |||
22 | This is fixed by using sparse_file_import() instead. This will fail | ||
23 | in the case that the file is not sparse and the call to | ||
24 | sparse_file_len() will be properly skipped. | ||
25 | |||
26 | Bug: 140538105 | ||
27 | Test: flash blueline factory image with assertions enabled in | ||
28 | libsparse/sparse.cpp | ||
29 | |||
30 | Change-Id: I0283be33563a3301ce5b09bde41105a20f91086c | ||
31 | |||
32 | https://android.googlesource.com/platform/system/core/+/fbb9535aaea5ae4011f3c3edf4c00b27452f57ec | ||
33 | Upstream-Status: Backport [commit fbb9535aaea5ae4011f3c3edf4c00b27452f57ec] | ||
34 | Signed-off-by: Nisha Parrakat <Nisha.Parrakat@kpit.com> | ||
35 | --- | ||
36 | fastboot/fastboot.cpp | 2 +- | ||
37 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
38 | |||
39 | diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp | ||
40 | index 3b7b5571..0ae9402e 100644 | ||
41 | --- a/fastboot/fastboot.cpp | ||
42 | +++ b/fastboot/fastboot.cpp | ||
43 | @@ -869,7 +869,7 @@ static bool load_buf_fd(int fd, struct fastboot_buffer* buf) { | ||
44 | return false; | ||
45 | } | ||
46 | |||
47 | - if (sparse_file* s = sparse_file_import_auto(fd, false, false)) { | ||
48 | + if (sparse_file* s = sparse_file_import(fd, false, false)) { | ||
49 | buf->image_size = sparse_file_len(s, false, false); | ||
50 | sparse_file_destroy(s); | ||
51 | } else { | ||
52 | -- | ||
53 | 2.36.1.vfs.0.0 | ||
54 | |||