HomeFreeBSD

kldxref: handle modules with md_cval at the end of allocated sections

Description

kldxref: handle modules with md_cval at the end of allocated sections

Attempting to retrieve an md_cval string from a kernel module with
kldxref would throw a offset error for modules created using lld, since
this value would be placed at the end of all allocated sections.

Add an ef_read_seg_string method to the ef interface, to allow reading
strings of varying size without attempting to read beyond the segment's
bounds.

PR: 224875
Submitted by: Mitchell Horne <mhorne063@gmail.com>
Reviewed by: cem, kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D13923

Details

Provenance
emasteAuthored on
Reviewer
cem
Differential Revision
D13923: Fix kldxref failing for modules with a short mc_cval
Parents
rS328051: MFC r327724: usbdevs: add ASMedia vendor ID
Branches
Unknown
Tags
Unknown