From 0048f6b4d138a5084ab0895e54f81bfa74d70f76 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Tue, 7 Mar 2017 20:00:08 +0000 Subject: If a user-defined macro is aborted because it exceeds the stack limit, usually due to infinite recursion, discard whatever remains in all those open stack levels. Otherwise, insane constructions like the following could generate macros of enormous size, causing mandoc(1) to die from memory exhaustion: .de m \" original macro definition .m \" recursion to blow up the stack .de m \" definition to be run during the call of .m marked (*) very long plain text (some kilobytes) .m \" expand the above a thousand times while unwinding the stack .. \" end of the original definition .m \" (*) recursively generate a ridiculously large macro .. \" end of recursively generated definition .m \" execute the giant macro, exhausting memory Very creative abuse found by tb@ with afl(1). --- regress/roff/de/Makefile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'regress/roff/de/Makefile') diff --git a/regress/roff/de/Makefile b/regress/roff/de/Makefile index 9488ce05..43bcf00f 100644 --- a/regress/roff/de/Makefile +++ b/regress/roff/de/Makefile @@ -1,7 +1,12 @@ # $OpenBSD: Makefile,v 1.9 2015/02/03 19:37:25 schwarze Exp $ -REGRESS_TARGETS = append cond escname factorial indir startde TH Dd -LINT_TARGETS = escname indir +REGRESS_TARGETS = append cond escname factorial indir infinite startde TH Dd +LINT_TARGETS = escname indir infinite + +# groff-1.22.3 defect: +# infinite recursion aborts output completely + +SKIP_GROFF = infinite .include -- cgit