相伴江湖 -- Be With You

2024年1月27日星期六

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 articles


  1. Pentest Tools Website
  2. Black Hat Hacker Tools
  3. Ethical Hacker Tools
  4. Pentest Tools Review
  5. Tools Used For Hacking
  6. Android Hack Tools Github
  7. Hacker Tools For Ios
  8. Beginner Hacker Tools
  9. Hackers Toolbox
  10. Hacking Tools Free Download
  11. Hacking Tools Pc
  12. Hack Tools For Games
  13. Pentest Tools Url Fuzzer
  14. Hacker
  15. Pentest Tools Port Scanner
  16. Hack Tools For Games
  17. Hack Tools Pc
  18. How To Hack
  19. Beginner Hacker Tools
  20. Hack Tools Pc
  21. Pentest Tools Website
  22. Best Hacking Tools 2019
  23. Hack Rom Tools
  24. Pentest Tools Framework
  25. Hacks And Tools
  26. Best Hacking Tools 2019
  27. Bluetooth Hacking Tools Kali
  28. Nsa Hacker Tools
  29. Pentest Recon Tools
  30. Hack Tools
  31. Pentest Tools Tcp Port Scanner
  32. Hacking App
  33. What Is Hacking Tools
  34. Pentest Tools For Mac
  35. Bluetooth Hacking Tools Kali
  36. Pentest Tools Alternative
  37. Blackhat Hacker Tools
  38. Hacker
  39. Underground Hacker Sites
  40. Hack And Tools
  41. How To Make Hacking Tools
  42. Hack Tools For Windows
  43. Pentest Tools Bluekeep
  44. Pentest Tools Download
  45. Pentest Tools Url Fuzzer
  46. Pentest Tools Subdomain
  47. Nsa Hack Tools
  48. Hack Tools
  49. Hacking Tools For Kali Linux
  50. Tools For Hacker
  51. Pentest Tools Linux
  52. Best Hacking Tools 2020
  53. Hacker
  54. Hack Rom Tools
  55. Hacker Tool Kit
  56. Pentest Tools Kali Linux
  57. Hacker Tool Kit
  58. What Are Hacking Tools
  59. Hacker Tools Linux
  60. Hack And Tools
  61. Hacker Tools Free
  62. Pentest Tools Website
  63. Pentest Tools For Mac
  64. Best Hacking Tools 2020
  65. Pentest Tools Tcp Port Scanner
  66. Pentest Reporting Tools
  67. What Are Hacking Tools
  68. Nsa Hack Tools Download
  69. Hacker Tools Free
  70. Game Hacking
  71. Hak5 Tools
  72. Hacking Tools Software
  73. Pentest Tools Free
  74. Hacker Tools 2019
  75. Hacking Tools Kit
  76. Best Hacking Tools 2020
  77. Pentest Tools Subdomain
  78. Bluetooth Hacking Tools Kali
  79. Hacking Tools For Windows
  80. Hack Tools 2019
  81. Hacking Tools For Windows 7
  82. Hacking Tools For Windows Free Download
  83. Hackers Toolbox
  84. Underground Hacker Sites
  85. Hak5 Tools
  86. Kik Hack Tools
  87. Best Hacking Tools 2019
  88. Hacking Tools For Games
  89. Pentest Tools Review
  90. Hack And Tools
  91. Hacker Tools Software
  92. Best Pentesting Tools 2018
  93. What Are Hacking Tools
  94. Hack Tools
  95. Pentest Tools Website
  96. Hacking Tools Hardware
  97. Hackrf Tools
  98. Tools For Hacker
  99. Hack Tools Download
  100. Usb Pentest Tools
  101. How To Make Hacking Tools
  102. Hacker Search Tools

0 条评论:

发表评论

订阅 博文评论 [Atom]



<< 主页