diff options
| author | Marek Vasut <marex@denx.de> | 2023-04-05 23:33:58 +0200 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2023-04-28 04:01:15 -1000 |
| commit | 09ec1332212de506bb83aa315f2ce86adaf2833c (patch) | |
| tree | 06f190fd01f796da0f24c2dbc8ce494d50b17507 | |
| parent | aa45ff43fc2fb8632932fcb83564702d187117e7 (diff) | |
| download | poky-09ec1332212de506bb83aa315f2ce86adaf2833c.tar.gz | |
cpio: Fix wrong CRC with ASCII CRC for large files
Due to signedness, the checksum is not computed when filesize is bigger
a 2GB. Pick a fix for this problem from CPIO ML, where the fix has been
posted for 5 years. Since CPIO upstream is effectively unresponsive and
any and all attempts to communicate with the maintainer and get the fix
applied upstream failed, add the fix here instead.
(From OE-Core rev: bdd1d3c8a0ef1e2086ea15e5c1b38628cfda5121)
Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit bfff138af4bdd356ac66571e6ad91c1a5599b935)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
| -rw-r--r-- | meta/recipes-extended/cpio/cpio-2.13/0001-Wrong-CRC-with-ASCII-CRC-for-large-files.patch | 39 | ||||
| -rw-r--r-- | meta/recipes-extended/cpio/cpio_2.13.bb | 1 |
2 files changed, 40 insertions, 0 deletions
diff --git a/meta/recipes-extended/cpio/cpio-2.13/0001-Wrong-CRC-with-ASCII-CRC-for-large-files.patch b/meta/recipes-extended/cpio/cpio-2.13/0001-Wrong-CRC-with-ASCII-CRC-for-large-files.patch new file mode 100644 index 0000000000..4b96e4316c --- /dev/null +++ b/meta/recipes-extended/cpio/cpio-2.13/0001-Wrong-CRC-with-ASCII-CRC-for-large-files.patch | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | From 77ff5f1be394eb2c786df561ff37dde7f982ec76 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Stefano Babic <sbabic@denx.de> | ||
| 3 | Date: Fri, 28 Jul 2017 13:20:52 +0200 | ||
| 4 | Subject: [PATCH] Wrong CRC with ASCII CRC for large files | ||
| 5 | |||
| 6 | Due to signedness, the checksum is not computed when filesize is bigger | ||
| 7 | a 2GB. | ||
| 8 | |||
| 9 | Upstream-Status: Submitted [https://lists.gnu.org/archive/html/bug-cpio/2017-07/msg00004.html] | ||
| 10 | Signed-off-by: Stefano Babic <sbabic@denx.de> | ||
| 11 | --- | ||
| 12 | src/copyout.c | 8 ++++---- | ||
| 13 | 1 file changed, 4 insertions(+), 4 deletions(-) | ||
| 14 | |||
| 15 | diff --git a/src/copyout.c b/src/copyout.c | ||
| 16 | index 1f0987a..727aeca 100644 | ||
| 17 | --- a/src/copyout.c | ||
| 18 | +++ b/src/copyout.c | ||
| 19 | @@ -34,13 +34,13 @@ | ||
| 20 | compute and return a checksum for them. */ | ||
| 21 | |||
| 22 | static uint32_t | ||
| 23 | -read_for_checksum (int in_file_des, int file_size, char *file_name) | ||
| 24 | +read_for_checksum (int in_file_des, unsigned int file_size, char *file_name) | ||
| 25 | { | ||
| 26 | uint32_t crc; | ||
| 27 | char buf[BUFSIZ]; | ||
| 28 | - int bytes_left; | ||
| 29 | - int bytes_read; | ||
| 30 | - int i; | ||
| 31 | + unsigned int bytes_left; | ||
| 32 | + unsigned int bytes_read; | ||
| 33 | + unsigned int i; | ||
| 34 | |||
| 35 | crc = 0; | ||
| 36 | |||
| 37 | -- | ||
| 38 | 2.7.4 | ||
| 39 | |||
diff --git a/meta/recipes-extended/cpio/cpio_2.13.bb b/meta/recipes-extended/cpio/cpio_2.13.bb index e72a114de9..dd3541096f 100644 --- a/meta/recipes-extended/cpio/cpio_2.13.bb +++ b/meta/recipes-extended/cpio/cpio_2.13.bb | |||
| @@ -10,6 +10,7 @@ SRC_URI = "${GNU_MIRROR}/cpio/cpio-${PV}.tar.gz \ | |||
| 10 | file://0001-Unset-need_charset_alias-when-building-for-musl.patch \ | 10 | file://0001-Unset-need_charset_alias-when-building-for-musl.patch \ |
| 11 | file://0002-src-global.c-Remove-superfluous-declaration-of-progr.patch \ | 11 | file://0002-src-global.c-Remove-superfluous-declaration-of-progr.patch \ |
| 12 | file://CVE-2021-38185.patch \ | 12 | file://CVE-2021-38185.patch \ |
| 13 | file://0001-Wrong-CRC-with-ASCII-CRC-for-large-files.patch \ | ||
| 13 | " | 14 | " |
| 14 | 15 | ||
| 15 | SRC_URI[md5sum] = "389c5452d667c23b5eceb206f5000810" | 16 | SRC_URI[md5sum] = "389c5452d667c23b5eceb206f5000810" |
