Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated __poll_chk implementation to be not so strict #549

Merged
merged 1 commit into from
Jul 3, 2019

Conversation

mxaddict
Copy link
Contributor

@mxaddict mxaddict commented Jul 1, 2019

This fixes a crash for navcoin-qt when libs call poll() with bad data.

Updated the __poll_chk to behave less aggressive (More like __explicit_bzero_chk)

Calls __chk_fail() instead of an assert which would terminate the execution of the rest of the app

@mxaddict
Copy link
Contributor Author

mxaddict commented Jul 1, 2019

@marcus290 this is a fix for the issue you found.

@mxaddict
Copy link
Contributor Author

mxaddict commented Jul 1, 2019

@aguycalled
Copy link
Member

Where do the original changes from d3b5687#diff-626fe822220cf08b83b6459ec6c2b29b which introduced the bug come from?

@mxaddict
Copy link
Contributor Author

mxaddict commented Jul 1, 2019

glob_old, wrap_glob and __wrap_glob64 I coded based on the __wrap_log2f code that was already in the file.

__poll_chk I based on glibc implementation, but I used assert (I did not know __chk_fail existed) : https://sourceware.org/git/?p=glibc.git;a=blob;f=debug/poll_chk.c;h=34596de9777b3fe9f05e8a57840dd75076c51672;hb=HEAD

__explicit_bzero_chk I based on monero implementation: https://github.com/monero-project/monero/blob/master/src/common/compat/glibc_compat.cpp

reallocarray from : libunbound in our ./depends dir

getentropy I think I coded myself.

@mxaddict mxaddict force-pushed the fix-__poll_chk-glib-compat-issue branch from 1f948a7 to b19b0df Compare July 1, 2019 16:16
@mxaddict
Copy link
Contributor Author

mxaddict commented Jul 1, 2019

I updated my commit to also remove the header for assert

Copy link
Member

@aguycalled aguycalled left a comment

Choose a reason for hiding this comment

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

Tested debian

@proletesseract
Copy link
Member

building in ubuntu 18.04

Copy link
Contributor

@marcus290 marcus290 left a comment

Choose a reason for hiding this comment

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

Tested on a 64-bit Linux gitian build on Ubuntu. Not getting the crash anymore

@mxaddict mxaddict merged commit ee83269 into navcoin:master Jul 3, 2019
proletesseract added a commit to proletesseract/navcoin-core that referenced this pull request Jul 3, 2019
proletesseract added a commit to proletesseract/navcoin-core that referenced this pull request Jul 3, 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.

None yet

4 participants