Page MenuHomeFreeBSD

kldxref: Properly handle reading strings near the end of an ELF file
ClosedPublic

Authored by jhb on Mar 18 2024, 11:42 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Oct 24, 9:42 PM
Unknown Object (File)
Fri, Oct 18, 4:37 PM
Unknown Object (File)
Wed, Oct 16, 7:52 PM
Unknown Object (File)
Wed, Oct 16, 7:52 PM
Unknown Object (File)
Wed, Oct 16, 7:52 PM
Unknown Object (File)
Wed, Oct 16, 7:31 PM
Unknown Object (File)
Sep 30 2024, 11:27 PM
Unknown Object (File)
Sep 23 2024, 11:19 AM
Subscribers

Details

Summary

If a string is at or near the end of an input file and the amount of
remaining data in the file is smaller than the maximum string size,
the pread(2) system call would return a short read which is treated as
an error. Instead, add a new helper function for reading a string
which permits short reads so long as the data read from the file
contains a terminated string.

Reported by: jrtc27

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable