Thursday, January 25, 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 links


  1. Hacker Hardware Tools
  2. Hacker Tools List
  3. Hacking Tools Name
  4. Hacker Tools Github
  5. Hacking Tools For Windows Free Download
  6. Easy Hack Tools
  7. Hack Tools Github
  8. Physical Pentest Tools
  9. Pentest Tools Windows
  10. Hack Tools Github
  11. Hack App
  12. Usb Pentest Tools
  13. Free Pentest Tools For Windows
  14. Nsa Hack Tools Download
  15. Hacking Tools Free Download
  16. Hack Tools For Ubuntu
  17. Pentest Tools Website Vulnerability
  18. Pentest Tools For Ubuntu
  19. Hacking Tools Kit
  20. Hackrf Tools
  21. Hackrf Tools
  22. Pentest Tools Apk
  23. Hacker Tools Free Download
  24. Hacker Tools For Windows
  25. Hacker Tools
  26. Pentest Tools Nmap
  27. Pentest Automation Tools
  28. How To Install Pentest Tools In Ubuntu
  29. Hacker Techniques Tools And Incident Handling
  30. Pentest Tools List
  31. Pentest Tools Port Scanner
  32. Pentest Box Tools Download
  33. New Hack Tools
  34. Pentest Tools Framework
  35. Hack Tools Online
  36. Pentest Tools For Windows
  37. Hack Tools Pc
  38. Nsa Hacker Tools
  39. Install Pentest Tools Ubuntu
  40. Pentest Tools Download
  41. Hack Tools Pc
  42. Pentest Tools Android
  43. Pentest Tools Port Scanner
  44. Pentest Tools Linux
  45. Hacker Techniques Tools And Incident Handling
  46. Game Hacking
  47. Best Hacking Tools 2020
  48. Hack Tools
  49. Install Pentest Tools Ubuntu
  50. Hack Tools Github
  51. Pentest Tools Website Vulnerability
  52. Hacker Security Tools
  53. Best Hacking Tools 2020
  54. Pentest Tools Download
  55. Pentest Tools Nmap
  56. Hack Tool Apk No Root
  57. Hacking Tools Kit
  58. Pentest Tools Review
  59. Hacker
  60. Hacking Tools Windows
  61. Hacker Tools For Mac
  62. Hacking Tools Github
  63. Hacker Security Tools
  64. Hacker
  65. Hacking Tools For Mac
  66. World No 1 Hacker Software
  67. Ethical Hacker Tools
  68. Best Pentesting Tools 2018
  69. Hack Tools
  70. Hack Tools Github
  71. Hacks And Tools
  72. Hacking Tools Pc
  73. Tools For Hacker
  74. Game Hacking
  75. Hacker Hardware Tools
  76. Hacking Tools For Pc
  77. Pentest Automation Tools
  78. Best Hacking Tools 2019
  79. Install Pentest Tools Ubuntu
  80. Nsa Hack Tools
  81. Pentest Tools For Ubuntu
  82. Hack Tools
  83. Hacker Tool Kit
  84. Hack Tool Apk No Root
  85. Hacker Tool Kit
  86. Nsa Hack Tools Download
  87. Tools 4 Hack
  88. Hack Tools Online
  89. Hacks And Tools
  90. Pentest Tools For Ubuntu
  91. Pentest Tools Download
  92. Pentest Tools Alternative
  93. Game Hacking
  94. Hacker Tools Apk Download
  95. Hack Rom Tools
  96. Hack Tools 2019
  97. Hacking Tools Download
  98. Kik Hack Tools
  99. Pentest Tools Linux
  100. Pentest Tools Port Scanner
  101. Hack Tools
  102. Hacking Tools For Pc
  103. Black Hat Hacker Tools
  104. Hacking Tools For Kali Linux
  105. Pentest Tools For Mac
  106. Hack Tools For Pc
  107. Best Pentesting Tools 2018
  108. Pentest Tools Online
  109. Hacker Tools For Pc
  110. Underground Hacker Sites
  111. Hacking Tools
  112. How To Install Pentest Tools In Ubuntu
  113. Pentest Tools Online
  114. Hack Tools Download
  115. Pentest Tools Port Scanner
  116. Best Hacking Tools 2020
  117. Wifi Hacker Tools For Windows
  118. Hack Apps
  119. Hacker Tools 2019
  120. Tools 4 Hack

No comments:

Post a Comment