gdk-pixbuf: fix memory leaks and API misuse in pixbuf_cons_fuzzer#15080
Open
OwenSanzas wants to merge 1 commit intogoogle:masterfrom
Open
gdk-pixbuf: fix memory leaks and API misuse in pixbuf_cons_fuzzer#15080OwenSanzas wants to merge 1 commit intogoogle:masterfrom
OwenSanzas wants to merge 1 commit intogoogle:masterfrom
Conversation
- Fix P1: free each intermediate GdkPixbuf before overwriting tmp - Fix P1: free GBytes (g_bytes_unref) on all paths - Fix P2: replace gdk_pixbuf_scale(src==dest) with gdk_pixbuf_scale_simple
|
OwenSanzas is a new contributor to projects/gdk-pixbuf. The PR must be approved by known contributors before it can be merged. The past contributors are: arthurscchan, hunsche, correctmost, tysmith, DonggeLiu, inferno-chromium, Google-Autofuzz, ecalp-tps |
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.
Summary
This is not a bug in gdk-pixbuf. It is a bug in the fuzz harness
pixbuf_cons_fuzzerthat causes memory leaks (1704 bytes in 8 allocations per iteration) detectable by LeakSanitizer, and an API contract violation (gdk_pixbuf_scalewith same src and dest).False Positive Impact
If left unfixed, any leak report from this fuzzer will be a false positive — the leaks originate in the harness, not in gdk-pixbuf. This can lead to:
Bugs Fixed
P1 (Harness Logic): Multiple intermediate
GdkPixbufobjects leaked —tmpis overwritten repeatedly without freeing previous values:Also,
GBytesfromg_bytes_new_static()is never freed.P2 (API Protocol):
gdk_pixbuf_scale(pixbuf, pixbuf, ...)uses the same pixbuf as both source and destination. The API documentation requires they be different.LSan Report
The leak triggers on the first seed corpus input and is 100% reproducible.
Fix
tmpwithg_object_unref()before reassignmentg_bytes_unref(bytes)on all pathsgdk_pixbuf_scale(src==dest)withgdk_pixbuf_scale_simple()