Monday, August 24, 2020

C++ Std::Condition_Variable Null Pointer Derreference


This story is about a bug generated by g++ and clang compilers (at least)
The condition_variables is a feature on the standard library of c++ (libstdc++), when its compiled statically a weird asm code is generated.


Any example on the link below will crash if its compiled statically:
 https://en.cppreference.com/w/cpp/thread/condition_variable



In this case the condition_variable.wait() crashed, but this happens with other methods, a simple way to trigger it:




If this program is compiled dynamically the crash doesn't occur:

Looking the dissasembly there is a surprise created by the compiler:


Compilers:
    g++  9.2.1+20200130-2
    clang++ v9

Both compilers are generating the "call 0x00"

If we check this call in a dynamic compiled:




The implementation of condition_variable in github:
https://github.com/gcc-mirror/gcc/blob/b7c9bd36eaacac42631b882dc67a6f0db94de21c/libstdc%2B%2B-v3/include/std/condition_variable


The compilers can't copile well this code in static,  and same happens on  other condition_variable methods.
I would say the _lock is being assembled improperly in static, is not exacly a null pointer derreference but the effects are the same, executing code at address 0x00 which on linux is a crash on most of cases.

More information
  1. Hack Tools For Games
  2. Usb Pentest Tools
  3. Pentest Tools Tcp Port Scanner
  4. Hacking Tools Free Download
  5. Hacker Tools Online
  6. Hacker Tools Free Download
  7. Hacking Tools Usb
  8. Hacker Tools Mac
  9. Free Pentest Tools For Windows
  10. Hacker Tools For Mac
  11. Ethical Hacker Tools
  12. Tools 4 Hack
  13. Hack Tools 2019
  14. What Are Hacking Tools
  15. Pentest Tools Github
  16. Hacking Tools Software
  17. Hacking Tools For Mac
  18. Hacker Tools Apk Download
  19. Growth Hacker Tools
  20. Hacker Tools Windows
  21. Hack Tools Online
  22. Hack Tools For Ubuntu
  23. Hack Tools
  24. Hack Tools 2019
  25. Pentest Recon Tools
  26. Hacking App
  27. Hacker Tools Mac
  28. Pentest Tools List
  29. Hacking Tools For Windows
  30. Hacking Tools Usb
  31. Hacker Tools Online
  32. Pentest Tools Website
  33. Hacking Tools Software
  34. Pentest Tools Windows
  35. Hacker Tools Software
  36. Hack Tools For Pc
  37. Pentest Tools Port Scanner
  38. Pentest Tools Website Vulnerability
  39. Pentest Recon Tools
  40. Hacking Tools For Mac
  41. Hacker Tools 2019
  42. Android Hack Tools Github
  43. Hacker Tools For Pc
  44. Hacker Tools For Pc
  45. Hack Tools 2019
  46. Underground Hacker Sites
  47. Hacking App
  48. Hacker Security Tools
  49. Pentest Tools List
  50. World No 1 Hacker Software
  51. Hacker Tools Linux
  52. How To Install Pentest Tools In Ubuntu
  53. Hacker Tools 2020
  54. Pentest Tools Free
  55. Hak5 Tools
  56. Hack Tools 2019
  57. Hacker Tools Linux
  58. Hacker Tools For Ios
  59. Nsa Hacker Tools
  60. Hacking Tools For Windows Free Download
  61. Hacker Tools Github
  62. Bluetooth Hacking Tools Kali
  63. Nsa Hack Tools Download
  64. Hack Tools
  65. How To Make Hacking Tools
  66. Hack Rom Tools
  67. Hack Tools Pc
  68. Free Pentest Tools For Windows
  69. Hacking Tools Github

No comments:

Post a Comment