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

No comments:

Post a Comment