Sunday, May 28, 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.

More articles


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

No comments:

Post a Comment