Skip to content

OSS-Fuzz: Add new fuzzer and corpora targets rtmp - #3516

Open
arthurscchan wants to merge 1 commit into
apache:masterfrom
arthurscchan:new-fuzzer
Open

OSS-Fuzz: Add new fuzzer and corpora targets rtmp#3516
arthurscchan wants to merge 1 commit into
apache:masterfrom
arthurscchan:new-fuzzer

Conversation

@arthurscchan

Copy link
Copy Markdown

This PR creates a new OSS-Fuzz fuzzer and corpora targets the rtmp process.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The new fuzzer harness should avoid ambiguous RTMP context initialization and an unnecessary input copy to prevent fragility and reduce fuzzing overhead.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR adds an RTMP-focused libFuzzer harness and wires it into the existing fuzzing build/OSS-Fuzz packaging flow for bRPC’s RTMP protocol implementation.

Changes:

  • Add a new fuzz_rtmp target that feeds data into the RTMP protocol parser.
  • Register fuzz_rtmp in the CMake fuzz target list so it’s built when BUILD_FUZZ_TESTS=ON.
  • Extend the OSS-Fuzz build script to build fuzz_rtmp and package an RTMP seed corpus zip.
File summaries
File Description
test/fuzzing/oss-fuzz.sh Builds fuzz_rtmp in OSS-Fuzz and packages fuzz_rtmp_seed_corpus into $OUT.
test/fuzzing/fuzz_rtmp.cpp New RTMP fuzzer harness calling into brpc::policy::ParseRtmpMessage.
test/CMakeLists.txt Adds fuzz_rtmp to the FUZZ_TARGETS list so it’s built with other fuzzers.
Review details
  • Files reviewed: 3/26 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread test/fuzzing/fuzz_rtmp.cpp Outdated
Comment thread test/fuzzing/fuzz_rtmp.cpp Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The new fuzzer initializes a full brpc server with default options and a fixed port range, which can add unnecessary overhead and reduce robustness in OSS-Fuzz environments.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 3/26 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread test/fuzzing/fuzz_rtmp.cpp
@wwbmmm
wwbmmm requested a lite review from Copilot September 7, 2026 14:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Pull request overview

Copilot reviewed 3 out of 26 changed files in this pull request and generated 3 comments.

Comment thread test/fuzzing/fuzz_rtmp.cpp
Comment thread test/fuzzing/oss-fuzz.sh
Comment thread test/fuzzing/fuzz_rtmp.cpp Outdated
Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Pull request overview

Copilot reviewed 3 out of 26 changed files in this pull request and generated 3 comments.

Comment thread test/fuzzing/fuzz_rtmp.cpp
Comment thread test/fuzzing/fuzz_rtmp.cpp
Comment thread test/fuzzing/oss-fuzz.sh

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The changes are isolated to fuzzing harness/build integration and appear consistent with existing fuzz target patterns in the repository.

Review details
  • Files reviewed: 3/26 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@wwbmmm
wwbmmm requested a lite review from Copilot September 8, 2026 03:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@wwbmmm
wwbmmm requested a lite review from Copilot September 8, 2026 04:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@wwbmmm
wwbmmm requested a lite review from Copilot September 8, 2026 05:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@wwbmmm
wwbmmm requested a lite review from Copilot September 8, 2026 06:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@wwbmmm
wwbmmm requested a lite review from Copilot September 8, 2026 07:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@wwbmmm
wwbmmm requested a lite review from Copilot September 8, 2026 08:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@wwbmmm
wwbmmm requested a lite review from Copilot September 8, 2026 09:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@wwbmmm
wwbmmm requested a lite review from Copilot September 8, 2026 11:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@wwbmmm
wwbmmm requested a lite review from Copilot September 8, 2026 12:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@wwbmmm
wwbmmm requested a lite review from Copilot September 8, 2026 13:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Pull request overview

Copilot reviewed 3 out of 26 changed files in this pull request and generated 5 comments.

if (sock == nullptr) {
return 0;
}
brpc::Server* server = get_fuzz_server();
Comment on lines +78 to +79
sock->reset_parsing_context(new brpc::policy::RtmpContext(nullptr, server));
brpc::policy::ParseRtmpMessage(&buf, sock, false, server);
Comment thread test/fuzzing/oss-fuzz.sh
zip $OUT/fuzz_http_seed_corpus.zip fuzz_http_seed_corpus/*
zip $OUT/fuzz_butil_seed_corpus.zip fuzz_butil_seed_corpus/*
zip $OUT/fuzz_hpack_seed_corpus.zip fuzz_hpack_seed_corpus/*
zip $OUT/fuzz_rtmp_seed_corpus.zip fuzz_rtmp_seed_corpus/*
Comment on lines +51 to +54
// Stop again straight away. _options -- and so rtmp_service -- is not
// touched by Stop()/Join()
server.Stop(0);
server.Join();
extern "C" int
LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
{
if (size < kMinInputLength || size > kMaxInputLength){
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