Bug 231072 - Mtree calculates checksum wrong when verifying a specification against a directory.
Summary: Mtree calculates checksum wrong when verifying a specification against a dire...
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 11.2-RELEASE
Hardware: amd64 Any
: --- Affects Many People
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-01 13:18 UTC by Kimmo Paasiala
Modified: 2018-09-01 15:27 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kimmo Paasiala 2018-09-01 13:18:39 UTC
https://www.freebsd.org/doc/handbook/security-intro.html the mtree(8) example at section 13.2.6 Binary Verification is not working correctly. The output from the verification step is empty as expected but the checksum printed differs from the one calculated at the specification creation step.

# mtree -s 3483151339707503 -c -K cksum,sha256digest -p /bin > /root/.bin_chksum_mtree
mtree: /bin checksum: 1817933408

# mtree -s 3483151339707503 -p /bin < /root/.bin_chksum_mtree >> /root/.bin_chksum_output    
mtree: /bin checksum: 1510745247

# file .bin_chksum_output 
.bin_chksum_output: empty

The system I'm using is:

# uname -a
FreeBSD firewall 11.2-RELEASE-p2 FreeBSD 11.2-RELEASE-p2 #3 r338073: Mon Aug 20 16:44:39 EEST 2018     root@firewall:/usr/obj/usr/src/sys/GENERIC  amd64

Filesystems used are ZFS all around except tmpfs /tmp and /var/run.