.

viernes, 19 de enero de 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.

More info
  1. Pentest Tools Linux
  2. Hack Tools For Games
  3. Pentest Tools Website Vulnerability
  4. Kik Hack Tools
  5. Hack Tools
  6. Hacker Tools 2020
  7. Pentest Tools Online
  8. Physical Pentest Tools
  9. New Hack Tools
  10. Hack Tools Pc
  11. Pentest Tools For Mac
  12. Top Pentest Tools
  13. Hacker Tools For Ios
  14. Hacking Tools For Windows Free Download
  15. Pentest Tools Review
  16. Hack Tools For Windows
  17. Wifi Hacker Tools For Windows
  18. Hack Tool Apk
  19. Pentest Tools Free
  20. Best Pentesting Tools 2018
  21. Hacker Tools Free
  22. Install Pentest Tools Ubuntu
  23. Pentest Tools Alternative
  24. Hacker Tools Windows
  25. Hacking Tools Download
  26. Pentest Tools Website Vulnerability
  27. Hacker Security Tools
  28. Github Hacking Tools
  29. Easy Hack Tools
  30. Kik Hack Tools
  31. Hacking Tools 2020
  32. How To Make Hacking Tools
  33. Hacking Tools Online
  34. Pentest Tools Website Vulnerability
  35. Hack Tools For Windows
  36. Hacker Tools
  37. Hacking Tools Windows
  38. Game Hacking
  39. Nsa Hacker Tools
  40. Computer Hacker
  41. Hacker Tools Linux
  42. Hack Tools Mac
  43. Hacker Tools Mac
  44. Ethical Hacker Tools
  45. Hacker Tools Free Download
  46. Hack Tools For Pc
  47. Nsa Hack Tools Download
  48. Tools 4 Hack
  49. Usb Pentest Tools
  50. Hacker Tools Free Download
  51. Hacker Security Tools
  52. Computer Hacker
  53. Pentest Tools Download
  54. Hacking Tools Name
  55. Hacking Tools For Mac
  56. Hack Apps
  57. Hacking Tools For Windows Free Download
  58. Best Hacking Tools 2019
  59. Hacker Hardware Tools
  60. Pentest Tools Website
  61. Hack Tools Online
  62. Physical Pentest Tools
  63. Hacking Tools For Beginners
  64. Best Pentesting Tools 2018
  65. Hack Tools Github
  66. Pentest Tools
  67. Hacking Tools Windows
  68. Pentest Tools Tcp Port Scanner
  69. Hacker Tools For Windows
  70. Tools For Hacker
  71. Hacking Tools Software
  72. Hack Tools Github
  73. Bluetooth Hacking Tools Kali
  74. Pentest Tools Windows
  75. Pentest Tools Online
  76. Hacker Security Tools
  77. Hacking Tools Pc
  78. Pentest Tools
  79. Hack Tools Github
  80. Usb Pentest Tools
  81. Pentest Tools Tcp Port Scanner
  82. Hacking Tools Mac
  83. Pentest Tools Website Vulnerability
  84. Hacking Tools Pc
  85. Underground Hacker Sites
  86. Pentest Tools Alternative
  87. New Hack Tools
  88. Hacker Tools For Windows
  89. Hack Tools For Ubuntu
  90. Hacker Security Tools
  91. Pentest Tools For Mac
  92. Pentest Tools Download