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)
Sat, May 18, 2:26 PM
Unknown Object (File)
Wed, May 8, 4:32 AM
Unknown Object (File)
Mon, May 6, 9:53 PM
Unknown Object (File)
Tue, Apr 30, 11:06 PM
Unknown Object (File)
Tue, Apr 30, 5:45 PM
Unknown Object (File)
Tue, Apr 30, 5:45 PM
Unknown Object (File)
Tue, Apr 30, 5:45 PM
Unknown Object (File)
Tue, Apr 30, 4:10 PM
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