Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor ImfCheckFile and oss-fuzz tests #1257

Merged

Conversation

peterhillman
Copy link
Contributor

Address https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=46459 by reorganizing Imf::CheckFile and tests.

CheckFile's logic for reducing memory usage hadn't been updated to support reading multiple parts using the RgbaFile API.
To reduce code spaghetti, CheckFile now uses the built-in limits for image and tile size rather than its own checks. Static methods to read those values have been added to Imf::Header to allow CheckFile to restore the original values before returning. (This extends the API and ABI but is backwards compatible)

Additionally, the interpretation of 'enableCoreChecks' (and exrcheck's "-c" flag) have been changed to run only the Core API tests, and not the C++ API tests. Previously, only files which were considered 'valid' by the Core API would be tested with the C++ API.

This change also splits the Core and C++ API tests into two separate binaries with the oss-fuzz suite: the new binary runs just the Core API. This should prevent timeout errors and also help to triage where issues may be occurring. The downside of this change is that fuzz tests will abort earlier when run on large images, so will be less able to detect vulnerabilities that may be present without those limits set.

Note oss-fuzz 46413 and 46432 may also be marked as resolved by this PR, but nothing has been done here to address those issues, so new related fuzz reports will likely appear

Signed-off-by: Peter Hillman peterh@wetafx.co.nz

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Copy link
Member

@cary-ilm cary-ilm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cary-ilm cary-ilm merged commit 672c77d into AcademySoftwareFoundation:main May 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants