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

No comments:

Post a Comment