Friday, 21 August 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.

Read more


  1. Hacking Tools Mac
  2. Tools For Hacker
  3. Pentest Tools Android
  4. Pentest Tools Open Source
  5. Hacking Tools For Games
  6. Hacking Tools Online
  7. Pentest Tools Website Vulnerability
  8. Hacking Tools For Pc
  9. Underground Hacker Sites
  10. Pentest Tools Github
  11. Hacking Tools For Windows Free Download
  12. Hack Website Online Tool
  13. Hacker Techniques Tools And Incident Handling
  14. Pentest Tools Url Fuzzer
  15. Hacker Tool Kit
  16. Hacker Hardware Tools
  17. New Hacker Tools
  18. Hacking Tools Hardware
  19. Hacker Tools Linux
  20. Hacking Tools For Kali Linux
  21. Hacker Tools Software
  22. Hacker Tools Online
  23. Wifi Hacker Tools For Windows
  24. Hacking Tools For Windows Free Download
  25. Best Pentesting Tools 2018
  26. Best Hacking Tools 2019
  27. Hacker Tools For Windows
  28. Hacker Tools
  29. Hacker Tools For Mac
  30. Hacking Tools For Beginners
  31. Wifi Hacker Tools For Windows
  32. Hack Tools For Games
  33. Nsa Hack Tools
  34. How To Hack
  35. Hacking Tools Pc
  36. Hack Tools Download
  37. Best Hacking Tools 2020
  38. Termux Hacking Tools 2019
  39. Pentest Tools Linux
  40. Pentest Box Tools Download
  41. New Hack Tools
  42. Hacking Tools Pc
  43. Wifi Hacker Tools For Windows
  44. How To Install Pentest Tools In Ubuntu
  45. Wifi Hacker Tools For Windows
  46. Hacker Tools For Mac
  47. Hacking Tools For Windows Free Download
  48. Pentest Tools Url Fuzzer
  49. Hackrf Tools
  50. What Are Hacking Tools
  51. Hacking App
  52. How To Make Hacking Tools
  53. Hacker Tools Mac
  54. Pentest Recon Tools
  55. Hak5 Tools
  56. Hacking Tools Hardware
  57. Pentest Tools Alternative
  58. Hacking Apps
  59. Best Hacking Tools 2019
  60. Pentest Tools Open Source
  61. Hacker Tools For Ios
  62. Hacker
  63. How To Hack
  64. Hack Tools For Mac
  65. Hacker Tools Mac
  66. Pentest Tools Free
  67. Pentest Reporting Tools
  68. Hacking Tools For Windows
  69. Hacker Tools Free Download
  70. Top Pentest Tools
  71. Hacking Tools Free Download
  72. What Is Hacking Tools
  73. Hacker Tools Apk Download
  74. Pentest Tools Url Fuzzer
  75. Beginner Hacker Tools
  76. Pentest Reporting Tools
  77. Beginner Hacker Tools
  78. Github Hacking Tools
  79. Pentest Tools Alternative
  80. World No 1 Hacker Software
  81. Nsa Hack Tools
  82. Pentest Tools Find Subdomains
  83. Pentest Tools For Android
  84. Pentest Tools Subdomain
  85. Black Hat Hacker Tools
  86. Hacker Tools 2019
  87. Blackhat Hacker Tools
  88. Pentest Tools Port Scanner
  89. Hack Tools Online
  90. Hacker Tools Online
  91. What Is Hacking Tools
  92. Hacker Tools Mac

No comments:

Post a Comment