Page MenuHomeFreeBSD

crunchgen: fix NULL-deref bug introduced in r364647
ClosedPublic

Authored by arichardson on Dec 4 2020, 2:14 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jun 21, 1:49 AM
Unknown Object (File)
May 23 2024, 4:48 AM
Unknown Object (File)
May 22 2024, 9:42 PM
Unknown Object (File)
May 22 2024, 3:50 PM
Unknown Object (File)
Apr 21 2024, 4:49 AM
Unknown Object (File)
Apr 5 2024, 10:56 AM
Unknown Object (File)
Mar 22 2024, 8:56 PM
Unknown Object (File)
Mar 22 2024, 8:56 PM
Subscribers

Details

Summary

While porting over the local changes from CheriBSD for upstreaming, I
accidentally committed a broken version of find_entry_point(): we have to
return NULL if the value is not found instead of a value with
ep->name == NULL, since the checks in main were changed to check ep instead
of ep->name for NULL.

This only matters if the crunched tool cannot be found using normal lookup
and one of the fallback paths is used, so it's unlikely to be triggered
in rescue. However, I noticed that one of our CheriBSD test scripts was
failing to run commands under su on minimal disk images where all
binaries are hardlinks to a cheribsdbox tool generated with crunchgen.

This also updates the bootstrapping check in Makefile.inc1 to bootstrap
crunchgen up to the next version bump.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Makefile.inc1
2273 ↗(On Diff #80309)

I don't know if this commit should also bump the version? I feel like just waiting for the next change should be fine, since worst-case it just unnecessarily builds one additional C file during bootstrap.

kevans added inline comments.
Makefile.inc1
2273 ↗(On Diff #80309)

IMO it's fine to just let it be a part of bootstrap until someone comes around to bump it again. As you noted, bootstrap crunchgen is just a tiny little blip in the build radar and there is an upper bound established.

This revision is now accepted and ready to land.Dec 4 2020, 2:22 PM