Wednesday, January 17, 2024

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.

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

No comments: