Skip to content

Fix some UBSAN warnings.#5901

Merged
acozzette merged 2 commits intoprotocolbuffers:masterfrom
htuch:fix-negative
Apr 1, 2019
Merged

Fix some UBSAN warnings.#5901
acozzette merged 2 commits intoprotocolbuffers:masterfrom
htuch:fix-negative

Conversation

@htuch
Copy link
Contributor

@htuch htuch commented Mar 15, 2019

  • external/com_google_protobuf/src/google/protobuf/stubs/strutil.cc:1122:9: runtime error: negation of -9223372036854775808 cannot be represented in type 'google::protobuf::int64' (aka 'long'); cast to an unsigned type to negate this value to itself

  • Bad external/com_google_protobuf/src/google/protobuf/text_format.cc:1320:14: runtime error: null pointer passed as argument 1, which is declared to never be null
    /usr/include/string.h:62:62: note: nonnull attribute specified here

Signed-off-by: Harvey Tuch htuch@google.com

* external/com_google_protobuf/src/google/protobuf/stubs/strutil.cc:1122:9: runtime error: negation of -9223372036854775808 cannot be represented in type 'google::protobuf::int64' (aka 'long'); cast to an unsigned type to negate this value to itself

* Bad external/com_google_protobuf/src/google/protobuf/text_format.cc:1320:14: runtime error: null pointer passed as argument 1, which is declared to never be null
  /usr/include/string.h:62:62: note: nonnull attribute specified here

Signed-off-by: Harvey Tuch <htuch@google.com>
htuch added a commit to htuch/oss-fuzz that referenced this pull request Mar 15, 2019
Fix in progress at
protocolbuffers/protobuf#5901, we might not
update Envoy with it for a while.

Signed-off-by: Harvey Tuch <htuch@google.com>
@anandolee anandolee requested a review from acozzette March 18, 2019 23:34
@anandolee anandolee added the c++ label Mar 18, 2019
inferno-chromium pushed a commit to google/oss-fuzz that referenced this pull request Mar 19, 2019
Fix in progress at
protocolbuffers/protobuf#5901, we might not
update Envoy with it for a while.

Signed-off-by: Harvey Tuch <htuch@google.com>
@acozzette
Copy link

@htuch If you don't mind could you either rebase this onto master or merge master into your branch? The Linux Ruby 2.6 test shows a strange crash. I don't see how it could be related to this pull request but maybe it's a separate issue that has since been fixed. For the other test failure (MacOS Ruby 2.3), let's not worry about that because I have a separate fix that just needs to be merged.

@htuch
Copy link
Contributor Author

htuch commented Mar 29, 2019

@aconchillo done

@acozzette acozzette merged commit 0f8e6d1 into protocolbuffers:master Apr 1, 2019
@acozzette
Copy link

Thanks @htuch!

htuch added a commit to htuch/envoy that referenced this pull request Apr 26, 2019
Since envoyproxy#6610 the fuzzer build has
been broken. This is due to the interaction of rules_foreign_cc external
dependencies and the additional UBSAN blacklist maintained by the
oss-fuzz driver to workaround the fact we don't have
protocolbuffers/protobuf#5901 yet.

Thir PR moves protocolbuffers/protobuf#5901 into
Envoy proper and hence we don't need an UBSAN blacklist in the oss-fuzz
driver anymore.

Risk level: Low
Tesitng: oss-fuzz Docker build.

Signed-off-by: Harvey Tuch <htuch@google.com>
htuch added a commit to envoyproxy/envoy that referenced this pull request Apr 26, 2019
Since #6610 the fuzzer build has
been broken. This is due to the interaction of rules_foreign_cc external
dependencies and the additional UBSAN blacklist maintained by the
oss-fuzz driver to workaround the fact we don't have
protocolbuffers/protobuf#5901 yet.

This PR moves protocolbuffers/protobuf#5901 into
Envoy proper and hence we don't need an UBSAN blacklist in the oss-fuzz
driver anymore.

Risk level: Low
Tesitng: oss-fuzz Docker build.

Signed-off-by: Harvey Tuch <htuch@google.com>
jeffpiazza-google pushed a commit to jeffpiazza-google/envoy that referenced this pull request May 3, 2019
Since envoyproxy#6610 the fuzzer build has
been broken. This is due to the interaction of rules_foreign_cc external
dependencies and the additional UBSAN blacklist maintained by the
oss-fuzz driver to workaround the fact we don't have
protocolbuffers/protobuf#5901 yet.

This PR moves protocolbuffers/protobuf#5901 into
Envoy proper and hence we don't need an UBSAN blacklist in the oss-fuzz
driver anymore.

Risk level: Low
Tesitng: oss-fuzz Docker build.

Signed-off-by: Harvey Tuch <htuch@google.com>
Signed-off-by: Jeff Piazza <jeffpiazza@google.com>
@asraa asraa mentioned this pull request Jul 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants