Bug 689954 - MOAB-06-01-2007.pdf eats up all cpu and stalls ghostscript.
Summary: MOAB-06-01-2007.pdf eats up all cpu and stalls ghostscript.
Status: NOTIFIED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PDF Interpreter (show other bugs)
Version: 8.70
Hardware: All All
: P4 critical
Assignee: Alex Cherepanov
URL: http://projects.info-pull.com/moab/MO...
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-09 04:32 UTC by Bernhard Weisshuhn
Modified: 2008-12-19 08:31 UTC (History)
0 users

See Also:
Customer:
Word Size: ---


Attachments
patch (1.36 KB, patch)
2008-07-28 22:00 UTC, Alex Cherepanov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bernhard Weisshuhn 2008-07-09 04:32:39 UTC
The file http://projects.info-pull.com/moab/bug-files/MOAB-06-01-2007.pdf makes
ghoscript 8.62 and current svn spit out a warning about a broken XREF table, and
then continues to eat up all CPU resources.

A detailed description of the design flaw illustrated by this pdf is available
at http://projects.info-pull.com/moab/MOAB-06-01-2007.html, also mentioning
potential more severe implications, which may or may not apply to ghostscript.
Other vendors have patched their clients in the meantime (Apple, Adobe, Poppler).
I.e. Poppler limited the max depth of recursive calls for reading the PageTree.
Maybe ghostscript could impose a sensible limit on these as well?

regards,
  bkw
Comment 1 Marcos H. Woehrmann 2008-07-09 06:59:22 UTC
Verified with 8.62 and head (r8825).
Comment 2 Alex Cherepanov 2008-07-28 22:00:41 UTC
Created attachment 4247 [details]
patch

Check for loops in the 'page tree' but accept an acyclic graph.
Report /syntaxerror and terminate the job when the loop is detected.

Regression testing shows no differences. We don't have other files so badly
broken.
Comment 3 Alex Cherepanov 2008-08-03 10:56:45 UTC
The patch is committed as a rev. 8933.