Skip to content

Don't merge!#5951

Closed
larsewi wants to merge 4 commits into
cfengine:masterfrom
larsewi:bogus
Closed

Don't merge!#5951
larsewi wants to merge 4 commits into
cfengine:masterfrom
larsewi:bogus

Conversation

@larsewi

@larsewi larsewi commented Nov 19, 2025

Copy link
Copy Markdown
Contributor

Signed-off-by: Lars Erik Wik lars.erik.wik@northern.tech

Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
On HP-UX IA-64, mixing 32-bit (%d) and 64-bit (%jd/%ju) format
specifiers in variadic arguments causes stack misalignment. In
StatFile(), cf_makeholes, cf_ino, and cf_nlink were passed as uncast
32-bit integers among 64-bit arguments, causing all subsequent values
(including cf_size) to be read from incorrect stack positions.

This resulted in the client receiving a corrupted file size value (e.g.,
212668465 instead of 821 bytes), triggering false "file corrupted in
transit" errors during file copy operations.

Fixed by casting cf_makeholes, cf_ino, and cf_nlink to (intmax_t) and
changing their format specifiers from %d to %jd, ensuring consistent
64-bit alignment for all variadic arguments after the first parameter.

Ticket: ENT-13508
Changelog: Title
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Ticket: None
Changelog: None
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Ticket: None
Changelog: None
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
@cf-bottom

Copy link
Copy Markdown

Thanks for submitting a PR! Maybe @craigcomstock can review this?

@larsewi larsewi closed this Nov 20, 2025
@larsewi larsewi deleted the bogus branch April 27, 2026 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants