]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix segment size in compressing core dumps
authorJustin Hibbits <jhibbits@FreeBSD.org>
Fri, 1 Oct 2021 18:39:18 +0000 (13:39 -0500)
committerJustin Hibbits <jhibbits@FreeBSD.org>
Fri, 1 Oct 2021 19:16:33 +0000 (14:16 -0500)
commit63cb9308a75b99fe057409705bc1b2ac0293f578
tree56ac4e5291afb8f10cd50934fc16ba9b18b81de4
parent0177102173f39e17366a32eb22653aeb5248c355
Fix segment size in compressing core dumps

A core segment is bounded in size only by memory size.  On 64-bit
architectures this means a segment can be much larger than 4GB.
However, compress_chunk() takes only a u_int, clamping segment size to
4GB-1, resulting in a truncated core.  Everything else, including the
compressor internally, uses size_t, so use size_t at the boundary here.

This dates back to the original refactor back in 2015 (r279801 /
aa14e9b7).

MFC after: 1 week
Sponsored by: Juniper Networks, Inc.
sys/kern/kern_exec.c