Skip to content

Add a libFuzzer target for libktx and a Linux CI job to run it - #1261

Closed
armatti wants to merge 1 commit into
KhronosGroup:mainfrom
armatti:libfuzzer-ci
Closed

armatti wants to merge 1 commit into
KhronosGroup:mainfrom
armatti:libfuzzer-ci

Conversation

@armatti

@armatti armatti commented Sep 30, 2026

Copy link
Copy Markdown

tests/fuzz is a CMake project of its own that adds lib/ as a sub-project, like tests/use-ktx, and builds ktx_read with Clang, libFuzzer instrumentation and ASan + UBSan. ktx_read_fuzzer loads each input as an application loads an untrusted file: create the texture, load the image data, transcode Basis Universal data and read all of it. Headers declaring more than 64 MiB of data are skipped before the data is loaded.

The new Fuzz job in linux.yml builds it, fuzzes for 10 minutes from the small KTX and KTX2 files in tests/resources and uploads any finding. It is separate from the ASan job because libFuzzer needs Clang and its own instrumented build.

  • A scheduled run with a persistent corpus (actions/cache, or ClusterFuzzLite's batch mode) would find deeper bugs than a fresh 10-minute run per PR.
  • Applying to OSS-Fuzz would give continuous fuzzing on Google's infrastructure; libktx isn't there yet.

tests/fuzz is a CMake project of its own that adds lib/ as a
sub-project, like tests/use-ktx, and builds ktx_read with Clang,
libFuzzer instrumentation and ASan + UBSan. ktx_read_fuzzer loads each
input as an application loads an untrusted file: create the texture,
load the image data, transcode Basis Universal data and read all of
it. Headers declaring more than 64 MiB of data are skipped before the
data is loaded.

The new Fuzz job in linux.yml builds it, fuzzes for 10 minutes from
the small KTX and KTX2 files in tests/resources and uploads any
finding. It is separate from the ASan job because libFuzzer needs
Clang and its own instrumented build.
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Ari-Matti Leppänen seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@armatti armatti closed this Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants