HomeFreeBSD

tarfs: Fix checksum calculation.

Description

tarfs: Fix checksum calculation.

The checksum code assumed that struct ustar_header filled an entire
block and calculcated the checksum based on the size of the structure.
The header is in fact only 500 bytes long while the checksum covers
the entire block (“logical record” in POSIX terms). Add padding and
an assertion, and clean up the checksum code.

MFC after: 3 days
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D44226

Details

Provenance
desAuthored on Mar 6 2024, 4:14 PM
Reviewer
imp
Differential Revision
D44226: tarfs: Fix checksum calculation.
Parents
rGe212f0c0666e: tarfs: Remove unnecessary hack and obsolete comment.
Branches
Unknown
Tags
Unknown