Skip to content

[tmux] add 6 additional fuzz harnesses#15472

Open
cglosner wants to merge 3 commits into
google:masterfrom
cglosner:tmux-additional-harnesses
Open

[tmux] add 6 additional fuzz harnesses#15472
cglosner wants to merge 3 commits into
google:masterfrom
cglosner:tmux-additional-harnesses

Conversation

@cglosner
Copy link
Copy Markdown

@cglosner cglosner commented May 7, 2026

Adds six additional fuzz targets to the tmux project, one per parsing/processing surface that the existing in-tree fuzzer (input-fuzzer) does not directly cover.

New target Source file Tmux entry point covered
input-parse-fuzzer-extra tmux-oss-fuzz/harnesses/input-parse-fuzzer-extra.c input_parse_buffer()
cmd-parse-fuzzer-extra tmux-oss-fuzz/harnesses/cmd-parse-fuzzer-extra.c cmd_parse_from_buffer()
layout-parse-fuzzer-extra tmux-oss-fuzz/harnesses/layout-parse-fuzzer-extra.c layout_parse()
utf8-fuzzer-extra tmux-oss-fuzz/harnesses/utf8-fuzzer-extra.c utf8_* family
format-fuzzer-extra tmux-oss-fuzz/harnesses/format-fuzzer-extra.c format_expand()
style-fuzzer-extra tmux-oss-fuzz/harnesses/style-fuzzer-extra.c style_parse()

The four existing in-tree fuzzers (input-fuzzer, cmd-parse-fuzzer, format-fuzzer, style-fuzzer) are unchanged.

What changed

  • projects/tmux/Dockerfile: pins the tmux clone to --branch master --depth 1 so every CI run rebuilds against current upstream, including in-flight bug fixes. Adds COPY tmux-oss-fuzz $SRC/tmux-oss-fuzz/ to vendor the additional harness sources.
  • projects/tmux/build.sh: after the existing make check builds the in-tree fuzzers, iterates over the six target names and compiles each extra harness against tmux's already-compiled object files. Includes tmux.o because tmux's --enable-fuzzing build path marks main() as weak — libFuzzer's main wins, and tmux.o provides global helpers (clean_name, getversion, setblocking, …) referenced by the other objects.
  • projects/tmux/project.yaml: trimmed of commented-out template lines; sanitizers and engines unchanged.
  • projects/tmux/tmux-oss-fuzz/harnesses/: new directory containing the six harness sources.

cglosner added 3 commits May 6, 2026 22:56
Adds 18 additional fuzz harnesses (6 targets x 3 generation
approaches) covering cmd-parse, format, input-parse, layout-parse,
style, and utf8.

Targets named <target>-<category>:
  *-manual:  hand-written
  *-llm:     LLM-enhanced with coverage hints
  *-fuzzgen: FuzzedDataProvider-style structured input

The harness sources are vendored under projects/tmux/tmux-oss-fuzz/
and built against tmux's already-compiled object files. The in-tree
input-fuzzer continues to be built and shipped unchanged.
Replaces the previous 18-harness set with one harness per parser/processor
surface, chosen as the highest-coverage variant from comparative
evaluation:

  input-parse-fuzzer-extra   (LLM-enhanced)
  cmd-parse-fuzzer-extra     (LLM-enhanced)
  layout-parse-fuzzer-extra  (manual)
  utf8-fuzzer-extra          (manual)
  format-fuzzer-extra        (manual)
  style-fuzzer-extra         (LLM-enhanced)

Dockerfile pins the tmux clone to --branch master so every build runs
against current upstream. utf8-fuzzer.c also fixed to only call
utf8_from_data() when utf8_fromwc() returned UTF8_DONE, removing a
harness-side fatalx() previously surfaced by check_build.
Renames the six vendored fuzz harnesses to <target>-fuzzer-extra.c
and places them in a single tmux-oss-fuzz/harnesses/ directory
(no manual/ or llm_generated/ subdirectories). build.sh now
iterates over the target list directly.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

cglosner is a new contributor to projects/tmux. The PR must be approved by known contributors before it can be merged. The past contributors are: yf0h, DonggeLiu, snizovtsev, inferno-chromium

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.

1 participant