Skip to contentSkip to conversation

cpio: Replace fix wrong CRC with ASCII CRC for large files with upstream backport

PATCH New Marek Vasut 1 participant 1 message Jul 1, 2023

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 cpio: Replace fix wrong CRC with ASCII CRC for large files with upstream backport

Replace the original "Wrong CRC with ASCII CRC for large files" patch with upstream backport, and add additional fix on top of the same problem which upstream detected and fixed.

---
NOTE: There is no oe-core/master counterpart, since oe-core/master
updated to cpio 2.14 in the meantime.
---
V2: Add U-S and SoB lines
---
Cc: Alexandre Belloni <[email protected]>
Cc: Khem Raj <[email protected]>
Cc: Richard Purdie <[email protected]>
Cc: Richard Purdie <[email protected]>
Cc: Ross Burton <[email protected]>
Cc: Steve Sakoman <[email protected]>

---
 ...g-CRC-with-ASCII-CRC-for-large-files.patch |  39 ---
 ...-calculation-of-CRC-in-copy-out-mode.patch |  58 ++++
 ...appending-to-archives-bigger-than-2G.patch | 312 ++++++++++++++++++
 meta/recipes-extended/cpio/cpio_2.13.bb       |   3 +-
 4 files changed, 372 insertions(+), 40 deletions(-)
 delete mode 100644 meta/recipes-extended/cpio/cpio-2.13/0001-Wrong-CRC-with-ASCII-CRC-for-large-files.patch
 create mode 100644 meta/recipes-extended/cpio/cpio-2.13/0003-Fix-calculation-of-CRC-in-copy-out-mode.patch
 create mode 100644 meta/recipes-extended/cpio/cpio-2.13/0004-Fix-appending-to-archives-bigger-than-2G.patch
meta/recipes-extended/cpio/cpio-2.13/0001-Wrong-CRC-with-ASCII-CRC-for-large-files.patch deleted +0 -39
deleted file mode 100644
index 4b96e4316c..0000000000
@@ -1,39 +0,0 @@
-From 77ff5f1be394eb2c786df561ff37dde7f982ec76 Mon Sep 17 00:00:00 2001
-From: Stefano Babic <[email protected]>
-Date: Fri, 28 Jul 2017 13:20:52 +0200
-Subject: [PATCH] Wrong CRC with ASCII CRC for large files
-
-Due to signedness, the checksum is not computed when filesize is bigger
-a 2GB.
-
-Upstream-Status: Submitted [https://lists.gnu.org/archive/html/bug-cpio/2017-07/msg00004.html]
-Signed-off-by: Stefano Babic <[email protected]>
----
- src/copyout.c | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/src/copyout.c b/src/copyout.c
-index 1f0987a..727aeca 100644
---- a/src/copyout.c
-+++ b/src/copyout.c
-@@ -34,13 +34,13 @@
-    compute and return a checksum for them.  */
- 
- static uint32_t
--read_for_checksum (int in_file_des, int file_size, char *file_name)
-+read_for_checksum (int in_file_des, unsigned int file_size, char *file_name)
- {
-   uint32_t crc;
-   char buf[BUFSIZ];
--  int bytes_left;
--  int bytes_read;
--  int i;
-+  unsigned int bytes_left;
-+  unsigned int bytes_read;
-+  unsigned int i;
- 
-   crc = 0;
- 
--- 
-2.7.4
-
meta/recipes-extended/cpio/cpio-2.13/0003-Fix-calculation-of-CRC-in-copy-out-mode.patch new file +58 -0

58 lines not on this page · raw message

meta/recipes-extended/cpio/cpio-2.13/0004-Fix-appending-to-archives-bigger-than-2G.patch new file +312 -0

312 lines not on this page · raw message

meta/recipes-extended/cpio/cpio_2.13.bb +2 -1
index dd3541096f..6ac5653eab 100644
@@ -10,7 +10,8 @@ SRC_URI = "${GNU_MIRROR}/cpio/cpio-${PV}.tar.gz \
            file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
            file://0002-src-global.c-Remove-superfluous-declaration-of-progr.patch \
            file://CVE-2021-38185.patch \
-           file://0001-Wrong-CRC-with-ASCII-CRC-for-large-files.patch \
+           file://0003-Fix-calculation-of-CRC-in-copy-out-mode.patch \
+           file://0004-Fix-appending-to-archives-bigger-than-2G.patch \
            "
 
 SRC_URI[md5sum] = "389c5452d667c23b5eceb206f5000810"
Signature · 1 line
2.40.1