Sunday, 30 August 2020

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 Open Source
  2. How To Hack
  3. Hacking Tools Free Download
  4. Hack Tools Pc
  5. Hacking Tools Pc
  6. Hacker Tools 2019
  7. Hacker Tools For Pc
  8. Nsa Hacker Tools
  9. Hack Tools Mac
  10. Hacking Tools Github
  11. Hacker Tools
  12. Ethical Hacker Tools
  13. Pentest Tools For Android
  14. Hack Tool Apk No Root
  15. Hacker Techniques Tools And Incident Handling
  16. Hacker Tool Kit
  17. Hacking Tools 2020
  18. Hacking Tools For Windows 7
  19. Best Pentesting Tools 2018
  20. Hacker Tools Free
  21. Hacking Tools For Beginners
  22. Hacks And Tools
  23. Hacker Tools For Mac
  24. Hacking Tools For Beginners
  25. Ethical Hacker Tools
  26. Pentest Tools Tcp Port Scanner
  27. Hack Tools
  28. Hacker Security Tools
  29. Pentest Tools Website Vulnerability
  30. Hacking Tools Pc
  31. Hacking App
  32. Hack Tools Pc
  33. Hacking Tools Software
  34. Hacking Tools 2019
  35. Growth Hacker Tools
  36. Physical Pentest Tools
  37. Hack Tools For Ubuntu
  38. Tools 4 Hack
  39. Hacking Tools Free Download
  40. Hacking Tools Kit
  41. Tools 4 Hack
  42. Hack Tool Apk No Root
  43. How To Make Hacking Tools
  44. Hacker Tools Apk Download
  45. Kik Hack Tools
  46. Hack Tools For Windows
  47. Hacker Tools Software
  48. Hacker Search Tools
  49. Hacker Tools For Ios
  50. Hacker Tools Apk
  51. Game Hacking
  52. Hacking Tools Kit
  53. Tools 4 Hack
  54. Game Hacking
  55. Hak5 Tools
  56. Nsa Hacker Tools
  57. Hacker Tools 2019
  58. Free Pentest Tools For Windows
  59. Wifi Hacker Tools For Windows
  60. Hacking Tools Software
  61. Pentest Tools Alternative
  62. Hacker Tools Apk
  63. Hacking Tools For Games
  64. Hacking App
  65. Hack Tools Pc
  66. Hacker Tools Apk Download
  67. Tools Used For Hacking
  68. Hacking App
  69. Hacker Tools Github
  70. Pentest Tools Tcp Port Scanner
  71. Bluetooth Hacking Tools Kali
  72. Pentest Tools Port Scanner
  73. Hacking Tools Hardware
  74. Hack Tools Online
  75. Hacking Tools Software
  76. Hack Tools
  77. How To Install Pentest Tools In Ubuntu
  78. Hack And Tools
  79. Pentest Tools Free
  80. Hack Tools Online
  81. Hacking App
  82. Hacking Tools For Windows Free Download
  83. Hacker Tools Free Download
  84. Pentest Tools Nmap
  85. Pentest Tools For Windows
  86. Hacks And Tools
  87. Computer Hacker
  88. Hacker Tool Kit
  89. Hacker Tools 2020
  90. Hacking Tools Usb
  91. What Is Hacking Tools
  92. Hacking Tools 2019
  93. Hacker Tools Hardware
  94. Hacker Tools List
  95. Hacking Tools For Kali Linux
  96. Pentest Tools Download
  97. Hak5 Tools
  98. Pentest Tools Linux
  99. Hacking Tools Download
  100. Usb Pentest Tools
  101. Nsa Hack Tools Download
  102. Hacking Tools Usb
  103. Hacker Tools Hardware
  104. World No 1 Hacker Software

No comments:

Post a Comment