bug-cpio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-cpio] Possible bug in CRC for file s> 2GB


From: Stefano Babic
Subject: [Bug-cpio] Possible bug in CRC for file s> 2GB
Date: Fri, 28 Jul 2017 12:48:14 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

Hi,

I see a strange behaviour when I packed a file larger as 2GB. I tested
with 2.11+dfsg-5ubuntu1 as well with cpio-2.12 (from sources).

I generated a large file with :

dd if=/dev/urandom of=mytest bs=512 count=4602240

And I have packed this together with a (small) ASCII file.

FILES="sw-description mytest"

for i in $FILES;do
        echo $i;done | cpio -ov -H crc >  result.swu

Checking into the header, I see that checksum for the big file is set to
0. Rerunning the generation of the file with urandom, I always get zero
(!!) for the checksum in the header. Evrything fine with smaller files.

This is for example when I try to pack the "kali" distro (it is just big
enough for test, I do not care which file..):

00000170  0a 09 7d 3b 0a 7d 0a 00  30 37 30 37 30 32 30 32
|..};.}..07070202|
00000180  37 30 30 42 34 45 30 30  30 30 38 31 42 34 30 30
|700B4E000081B400|
00000190  30 30 30 33 45 38 30 30  30 30 30 33 45 38 30 30
|0003E8000003E800|
000001a0  30 30 30 30 30 31 35 39  37 42 31 33 44 35 38 43
|000001597B13D58C|
000001b0  37 33 30 30 30 30 30 30  30 30 30 30 30 38 30 30
|7300000000000800|
000001c0  30 30 30 30 32 31 30 30  30 30 30 30 30 30 30 30
|0000210000000000|
000001d0  30 30 30 30 30 30 30 30  30 30 30 30 31 42 30 30
|0000000000001B00|
000001e0  30 30 30 30 30 30 6b 61  6c 69 2d 6c 69 6e 75 78
|000000kali-linux|
000001f0  2d 31 2e 30 2e 33 2d 61  6d 64 36 34 2e 69 73 6f
|-1.0.3-amd64.iso|

1B = Length of filename ==> OK
CRC = 0 (it should be f385b428)

CRC is zero - and when I read the packed data with another software (not
CPIO), that is expecting the header and the CRC, an error is of course
raised.

Am I missing something ?

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: address@hidden
=====================================================================



reply via email to

[Prev in Thread] Current Thread [Next in Thread]