Bug 5459 - Defective FS structure can make checksum count negative
Defective FS structure can make checksum count negative
Status: CLOSED FIXED
Product: rsync
Classification: Unclassified
Component: core
3.0.3
x64 Linux
: P3 minor
: ---
Assigned To: Wayne Davison
Rsync QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-05-12 07:40 UTC by Andreas Kotes
Modified: 2008-07-28 20:14 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Kotes 2008-05-12 07:40:19 UTC
read_sum_head() in io.c expects the checksum count to be a signed int (most likely should be long). For large file counts, this can become negative:

receiving file list ...
2289961 files to consider
Invalid checksum count -909869055 [sender]
rsync error: protocol incompatibility (code 2) at io.c(1361) [sender=3.0.2]
rsync: connection unexpectedly closed (31026252 bytes received so far) [receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(635) [receiver=3.0.2]
rsync: connection unexpectedly closed (31026252 bytes received so far) [generator]
rsync error: error in rsync protocol data stream (code 12) at io.c(635) [generator=3.0.2]

... and this is only a subfolder. Working with the original 55137908 in one block doesn't work at all.
Comment 1 Andreas Kotes 2008-05-12 13:41:31 UTC
seems like a broken directory entry causes this:

-rwxr-x-w- 1 1727  521 1006641549938245 2007-12-10 15:04 709.jpg

.. so this is an FS problem, not an rsync problem. rsync should provide a better error description, though.
Comment 2 Wayne Davison 2008-05-12 18:27:22 UTC
I agree that the generator should not request a file that it cannot send the right count of checksums for.  (Which should be something in the range of a 256 TB file or so.)
Comment 3 Wayne Davison 2008-05-31 12:18:56 UTC
The code now checks to ensure that the checksum structure is valid before sending it over the wire.