aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/diff
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2026-07-27 15:42:49 +0000
committerMark Johnston <markj@FreeBSD.org>2026-07-29 17:48:13 +0000
commit008d3bafa124fc0751cbacbd0557cb1927856624 (patch)
tree8188957d2a0675a0898b8b22fa9b60cb5e709641 /usr.bin/diff
parente2585687890e449850497b6f018b1fd53d944611 (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 'usr.bin/diff')
0 files changed, 0 insertions, 0 deletions