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

[Arch package] stack smashing detected by Fortify #2549

Closed
FrederikLauber opened this issue Jul 21, 2017 · 10 comments
Closed

[Arch package] stack smashing detected by Fortify #2549

FrederikLauber opened this issue Jul 21, 2017 · 10 comments
Labels
A-packaging Area: Packaging I-fail-to-run The zcashd binary fails to start, or crashes shortly after starting. I-SECURITY Problems and improvements related to security. portability

Comments

@FrederikLauber
Copy link

Can you reliably reproduce the issue?

If so, please list the steps to reproduce below:

  1. run zcashd
  2. observe crash with "stack smashing detected" within a few seconds

Expected behaviour

zcash should be running

Machine specs:

  • Arch Linux

Here is the issue on the Arch Linux Bug tracker including a stack trace.
https://bugs.archlinux.org/task/54835

@daira
Copy link
Contributor

daira commented Jul 21, 2017

That's odd because the failure is from Fortify, but we always compile with Fortify enabled already (and test that it is actually enabled).

The trace linked from the Arch ticket is from a stripped executable. Can you recompile the Arch package without stripping symbols? Also, can you link to any patches that were applied to build the Arch package?

@daira daira changed the title stack smashing detected [Arch package] stack smashing detected Jul 21, 2017
@daira daira changed the title [Arch package] stack smashing detected [Arch package] stack smashing detected by Fortify Jul 21, 2017
@daira daira added I-SECURITY Problems and improvements related to security. I-fail-to-run The zcashd binary fails to start, or crashes shortly after starting. A-packaging Area: Packaging portability labels Jul 21, 2017
@eli-schwartz
Copy link

Arch uses three patches: https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/zcash#n24
The patches themselves can be seen here: https://git.archlinux.org/svntogit/community.git/tree/trunk?h=packages/zcash

It's not doing anything other than using system libraries for libgmp, libsodium, and rust (I assume because your build system doesn't inherently have any way to do that), and fix a boost linker flag.

@daira
Copy link
Contributor

daira commented Jul 21, 2017

Hmm, what versions are the system Boost, libsodium, and Rust? It is plausible that memory safety bugs in one of those dependencies have been fixed between the system versions and the ones we normally use (i.e. Boost 1.62.0, libsodium 1.0.11, and Rust 1.16.0).

@daira
Copy link
Contributor

daira commented Jul 21, 2017

Also, what gcc/g++ and binutils are you using?

@daira
Copy link
Contributor

daira commented Jul 21, 2017

BTW, if the system Boost is compiled with single-threaded option then that would definitely cause a problem. But I suspect that it's compiled for multi-threaded and just lacks the "-mt" on the library name.

@eli-schwartz
Copy link

eli-schwartz commented Jul 21, 2017

Our repos are at:
libsodium 1.0.13-1 (initially built with 1.0.12-1)
boost 1.64.0-4
rust 1:1.18.0-1
gcc 7.1.1-4

Our boost package is compiled with --layout=system threading=multi. 😄

(Also note that I don't use this software, I am here because I triaged the bug on our bugtracker and followed the link here.)

@daira daira added this to Work Queue in Portability Jul 21, 2017
@tensor5
Copy link

tensor5 commented Jul 22, 2017

Arch package works after rebuilding, issue https://bugs.archlinux.org/task/54835 has been closed.

@daira
Copy link
Contributor

daira commented Jul 22, 2017

Any idea what was different between the original build and the rebuild?

@tensor5
Copy link

tensor5 commented Jul 22, 2017

@daira I'm not sure if this is related, but the default Arch's CFLAGS recently changed, and glibc was rebuilt with the new flags.

@bitcartel
Copy link
Contributor

This is now resolved. Closing.

@bitcartel bitcartel added this to Complete in User Support Jul 24, 2017
@str4d str4d moved this from Work Queue to Complete in Portability Nov 10, 2017
@daira daira added this to Complete in Security and Stability Nov 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-packaging Area: Packaging I-fail-to-run The zcashd binary fails to start, or crashes shortly after starting. I-SECURITY Problems and improvements related to security. portability
Projects
User Support
  
Complete
Portability
  
Complete
Development

No branches or pull requests

5 participants