Page MenuHomeFreeBSD

man(1): avoid endless loop in .so includes
ClosedPublic

Authored by wosch on Jul 18 2025, 2:47 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Oct 10, 5:54 AM
Unknown Object (File)
Fri, Oct 10, 5:54 AM
Unknown Object (File)
Fri, Oct 10, 5:54 AM
Unknown Object (File)
Fri, Oct 10, 5:54 AM
Unknown Object (File)
Fri, Oct 10, 5:54 AM
Unknown Object (File)
Fri, Oct 10, 12:17 AM
Unknown Object (File)
Wed, Oct 8, 9:17 PM
Unknown Object (File)
Thu, Oct 2, 2:52 PM

Details

Summary

I think the solution is to limit the number of includes to a value of 10 instead infinity.

See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=287037

Diff Detail

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

Event Timeline

wosch requested review of this revision.Jul 18 2025, 2:47 PM
wosch created this revision.

Simplify while loop & fix an indent issue.

imp added a subscriber: imp.

10 might be too small. But if so, it's easy to bump to 20

This revision is now accepted and ready to land.Jul 18 2025, 3:00 PM

Is it worth emitting a warning on stderr if we exit the loop due to the limit?

In D51412#1173928, @imp wrote:

10 might be too small. But if so, it's easy to bump to 20

I checked the ports manual pages. The highest number of includes is 8. On Linux the zshall.1 has 15 includes. I will increase the limit to 32.

Increase .so include limit to 32, and display a warning if we reach the limit in debug mode.

This revision now requires review to proceed.Jul 18 2025, 3:33 PM
This revision was not accepted when it landed; it landed in state Needs Review.Jul 21 2025, 7:25 AM
This revision was automatically updated to reflect the committed changes.