]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Use EF_SEG_READ_STRING instead of EF_SEG_READ when reading strings.
authorimp <imp@FreeBSD.org>
Sun, 15 Jul 2018 05:29:39 +0000 (05:29 +0000)
committerimp <imp@FreeBSD.org>
Sun, 15 Jul 2018 05:29:39 +0000 (05:29 +0000)
commit5991b259dc72f9ae3939f250a6ad287f7db69604
treee303846328b2475a27cd23ffebd4453a006a447a
parentfd2ad050dc84d8885509d2836f4d02d3f2c6fa56
Use EF_SEG_READ_STRING instead of EF_SEG_READ when reading strings.

Normally, we can get away with just reading the 1k buffer for the
string, since the placement of the data is generally no where near the
end of the file. However, it's possible that the string is within the
last 1k of the file, in which case the read will fail, and we'll not
produce the proper records needed for devmatch to work. By reading
using EF_SEG_READ_STRING, we automatically work around these problems
while still retaining safety.

This fix a problem with devmatch where we wouldn't load certain
modules (like ums). This didn't always happen (my tree didn't exhibit
it, while nathan's did because his optimization options were more
agressive).

Reported by: nathanw@
usr.sbin/kldxref/kldxref.c