Repository navigation
fix raster over-read on undersized media in ipptransform - #191
Open
tanjiroK-coder wants to merge 1 commit into
Open
tanjiroK-coder wants to merge 1 commit into
tanjiroK-coder wants to merge 1 commit into
Conversation
michaelrsweet
requested changes
Oct 22, 2026
michaelrsweet
left a comment
Member
There was a problem hiding this comment.
Will consider, needs cleanup for coding style. Also, no need for a long-term unit test for this and we prefer to write up the changelog entries...
pcl_start_page and ps_start_page subtract a fixed 1/4" or 1/6" margin from the unsigned cupsWidth/cupsHeight, which wraps around when the media is smaller than twice the margin so right/bottom become ~4 billion and the per-line and band-row counts run past the raster buffer. Drop a margin to zero when the page is too small to hold it so the subtraction stays in range.
tanjiroK-coder
force-pushed
the
ipptransform-margin-underflow
branch
from
October 23, 2026 07:50
e4db51e to
ec05a00
Compare
Contributor
Author
|
Cleaned up the coding style and dropped the test, now just the margin fix in |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pcl_start_pageandps_start_pagebuild the page margins by subtracting a fixed 1/4" (PCL) or 1/6" (PostScript) margin fromcupsWidth/cupsHeightinto unsigned fields. When the media is smaller than twice that margin the subtraction wraps around, sorightandbottombecome ~4 billion.dither_gray/pack_*readright - leftpixels per line and the band loop iteratesbottom - toprows, so both then run far past the band buffer.The media size is attacker-reachable:
ippeveprinterand the rest of the IPP Everywhere path pass the job's media, including small custom and roll sizes, straight to this filter. On a sanitizer build it is a heap-buffer-overflow READ (adjacent heap bytes end up in the output raster):Dropping a margin to zero when the page is too small to hold it keeps the computation in range; output for normal media is byte-identical. Added a tiny-media transform to
run-tests.shthat aborts on the unpatched tree under the address sanitizer the CI already uses.