miércoles, mayo 31, 2023

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 articles


  1. Hacking Tools Name
  2. Hacker Tools 2019
  3. Hacker Tool Kit
  4. Pentest Tools Nmap
  5. What Are Hacking Tools
  6. Pentest Box Tools Download
  7. What Are Hacking Tools
  8. Hack Tools For Games
  9. Kik Hack Tools
  10. Tools 4 Hack
  11. Hacker Tools Linux
  12. Best Hacking Tools 2020
  13. Hacking Tools And Software
  14. What Are Hacking Tools
  15. Hack Tool Apk
  16. Hacking Tools Software
  17. Best Hacking Tools 2020
  18. How To Install Pentest Tools In Ubuntu
  19. Hacker Tools 2019
  20. Hacker Tool Kit
  21. Nsa Hack Tools
  22. Hack Tools For Mac
  23. Hacking Tools Download
  24. Hacker
  25. Hack Rom Tools
  26. Hacking Tools
  27. Pentest Tools Port Scanner
  28. Hack Tools Download
  29. Wifi Hacker Tools For Windows
  30. Game Hacking
  31. Hack Apps
  32. Hacking Tools 2019
  33. Hacker Search Tools
  34. Hack Tools
  35. Ethical Hacker Tools
  36. Underground Hacker Sites
  37. Hacker Tool Kit
  38. Hacking Tools Windows 10
  39. Pentest Reporting Tools
  40. Hacking Tools 2019
  41. Pentest Recon Tools
  42. Pentest Tools Website
  43. Hack Tools Pc
  44. Blackhat Hacker Tools
  45. Hacking Tools Github
  46. Pentest Automation Tools
  47. Hack And Tools
  48. Pentest Tools Nmap
  49. Hacker Techniques Tools And Incident Handling
  50. Pentest Tools Website
  51. Hacker Tools 2019
  52. Pentest Tools Kali Linux
  53. Hack Tools For Games
  54. Pentest Tools Tcp Port Scanner
  55. Pentest Tools Subdomain
  56. Pentest Tools Open Source
  57. Pentest Tools Alternative
  58. Hack Tool Apk No Root
  59. Hacking Tools Windows 10
  60. Hacker Tools For Ios
  61. Best Hacking Tools 2020
  62. Hacking Tools Mac
  63. Pentest Tools Port Scanner
  64. Physical Pentest Tools
  65. Pentest Tools Apk
  66. Android Hack Tools Github
  67. Hacker Tools For Ios
  68. Hacker Tools 2019
  69. Black Hat Hacker Tools
  70. Hacking Tools Kit
  71. Hacks And Tools
  72. New Hacker Tools
  73. Hack Rom Tools
  74. Hack Tools Mac
  75. Hacking Tools Kit
  76. Pentest Tools Online
  77. Hacker Security Tools
  78. Pentest Tools Open Source
  79. Game Hacking
  80. Hack Tools Download
  81. Hacking Tools Kit
  82. Pentest Tools Kali Linux
  83. Pentest Tools Bluekeep
  84. Hacker Hardware Tools
  85. Hacker Search Tools
  86. Computer Hacker
  87. Pentest Recon Tools
  88. Beginner Hacker Tools
  89. Growth Hacker Tools
  90. Hacker Tools Windows
  91. Hacking Tools Online
  92. Github Hacking Tools
  93. Nsa Hack Tools Download
  94. Hack Tools Mac
  95. Tools Used For Hacking
  96. Hack Rom Tools
  97. Pentest Tools Open Source
  98. Hacking Tools Online
  99. Hacking Tools Hardware
  100. Hacker Search Tools
  101. Pentest Tools List
  102. Best Hacking Tools 2019
  103. Hack Tools For Pc
  104. Hacking Tools For Windows
  105. Hacker Tools Apk Download
  106. Hack Tools Mac
  107. Hacker Search Tools
  108. Hacker Tools Hardware
  109. Pentest Tools
  110. Hacker Tools Linux
  111. Hacker Tools Apk
  112. Hak5 Tools
  113. Best Pentesting Tools 2018
  114. Hacker Tools 2019
  115. Hacking Tools For Windows
  116. Pentest Tools Bluekeep
  117. Hacker Tools Apk Download
  118. Hacking Tools Name
  119. Top Pentest Tools
  120. Growth Hacker Tools
  121. Hacking Tools Hardware
  122. Bluetooth Hacking Tools Kali
  123. Hacker Tools List
  124. Pentest Box Tools Download
  125. Pentest Tools Framework
  126. New Hack Tools
  127. Hack Website Online Tool
  128. Hack Tools 2019
  129. Hacking Apps
  130. Best Pentesting Tools 2018
  131. Pentest Tools Website Vulnerability
  132. What Is Hacking Tools
  133. Hack Tools For Pc
  134. Hacker Search Tools
  135. Hacking Tools Windows
  136. Hacking Tools Mac
  137. Pentest Tools Kali Linux
  138. Pentest Tools Review
  139. Hacker Tools Apk Download
  140. Hacker Tools Hardware
  141. Hacker Tools Mac
  142. Pentest Tools Website
  143. What Are Hacking Tools
  144. Easy Hack Tools
  145. Hack Tools For Games
  146. Hacker
  147. Hacker Tools Software
  148. Hacking Tools Online
  149. Ethical Hacker Tools
  150. Pentest Tools Website
  151. Hacker Tools
  152. Physical Pentest Tools
  153. Nsa Hack Tools Download
  154. Hacking Tools For Mac
  155. Wifi Hacker Tools For Windows
  156. Hacks And Tools