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.

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

No comments: