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

No comments:

Post a Comment