Saturday, May 27, 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.

Related posts


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

No comments: