Merge pull request #14032 from ctiller/api-fuzz

Fix issue whereby fuzzer creates infinitely deep creds (since this is not actually interesting)
pull/14005/head
Craig Tiller 7 years ago committed by GitHub
commit cd92e3bc6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      test/core/end2end/fuzzers/api_fuzzer.cc
  2. BIN
      test/core/end2end/fuzzers/api_fuzzer_corpus/fuzz-input-d2ab5
  3. 23
      tools/run_tests/generated/tests.json

@ -280,7 +280,12 @@ static grpc_channel_credentials* read_ssl_channel_creds(input_stream* inp) {
return creds;
}
static grpc_call_credentials* read_call_creds(input_stream* inp) {
static grpc_call_credentials* read_call_creds(input_stream* inp, int depth) {
if (depth > 64) {
// prevent creating infinitely deep call creds
end(inp);
return nullptr;
}
switch (next_byte(inp)) {
default:
end(inp);
@ -288,8 +293,8 @@ static grpc_call_credentials* read_call_creds(input_stream* inp) {
case 0:
return nullptr;
case 1: {
grpc_call_credentials* c1 = read_call_creds(inp);
grpc_call_credentials* c2 = read_call_creds(inp);
grpc_call_credentials* c1 = read_call_creds(inp, depth + 1);
grpc_call_credentials* c2 = read_call_creds(inp, depth + 1);
if (c1 != nullptr && c2 != nullptr) {
grpc_call_credentials* out =
grpc_composite_call_credentials_create(c1, c2, nullptr);
@ -338,7 +343,7 @@ static grpc_channel_credentials* read_channel_creds(input_stream* inp) {
break;
case 1: {
grpc_channel_credentials* c1 = read_channel_creds(inp);
grpc_call_credentials* c2 = read_call_creds(inp);
grpc_call_credentials* c2 = read_call_creds(inp, 0);
if (c1 != nullptr && c2 != nullptr) {
grpc_channel_credentials* out =
grpc_composite_channel_credentials_create(c1, c2, nullptr);

@ -105417,6 +105417,29 @@
],
"uses_polling": false
},
{
"args": [
"test/core/end2end/fuzzers/api_fuzzer_corpus/fuzz-input-d2ab5"
],
"ci_platforms": [
"linux"
],
"cpu_cost": 0.1,
"exclude_configs": [
"tsan"
],
"exclude_iomgrs": [
"uv"
],
"flaky": false,
"language": "c",
"name": "api_fuzzer_one_entry",
"platforms": [
"mac",
"linux"
],
"uses_polling": false
},
{
"args": [
"test/core/end2end/fuzzers/api_fuzzer_corpus/poc-c726ee220e980ed6ad17809fd9efe2844ee61555ac08e4f88afd8901cc2dd53a"

Loading…
Cancel
Save