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
F146977709: D51412.id.diff
Sat, Mar 7, 7:03 AM
Unknown Object (File)
Fri, Feb 27, 11:23 PM
Unknown Object (File)
Thu, Feb 19, 5:17 PM
Unknown Object (File)
Wed, Feb 18, 11:37 AM
Unknown Object (File)
Mon, Feb 16, 10:51 PM
Unknown Object (File)
Wed, Feb 11, 11:31 PM
Unknown Object (File)
Sun, Feb 8, 10:28 AM
Unknown Object (File)
Sat, Feb 7, 7:41 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.