aboutsummaryrefslogtreecommitdiff
path: root/lib/libwrap
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2026-07-27 15:42:49 +0000
committerMark Johnston <markj@FreeBSD.org>2026-07-28 14:38:27 +0000
commitd46ec216104e2f8e6f0eb9f1967c772e54eeda54 (patch)
treee225333b522184c5f8d217af5c9218d6b36af028 /lib/libwrap
parentb5eaa00cdba3a66ab20841df5620e18ff750207a (diff)
coredump: Don't assume that the number of ELF segments is consistent
In an ELF coredump, each dumped vm_map_entry is represented by a segment. __elfN(coredump) first computes the number of segments by looping over the vm_map entries (in each_dumpable_segment()), then allocates a buffer to hold the ELF header and program headers, then loops over the entries again to populate the program headers. each_dumpable_segment() holds the vm_map read lock, but that lock is dropped between the two calls. If the map is shared with another process, via rfork(), then the map can change. cb_put_phdr() did not account for this, and so could write out of bounds. Add a check to prevent this; simply do not write out excess segments. Approved by: so Security: FreeBSD-SA-26:55.elf Security: CVE-2026-58088 Reported by: Maik Muench of Secfault Security Reviewed by: kib, emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D58416
Diffstat (limited to 'lib/libwrap')
0 files changed, 0 insertions, 0 deletions