sábado, 27 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.

Related news
  1. Hack Tools
  2. Hacker Tools List
  3. Blackhat Hacker Tools
  4. Hack Tools For Ubuntu
  5. Pentest Recon Tools
  6. Beginner Hacker Tools
  7. Hak5 Tools
  8. Hacker Tools List
  9. Hacking Tools Download
  10. Hacks And Tools
  11. Hacker Techniques Tools And Incident Handling
  12. Hacker Tools
  13. Github Hacking Tools
  14. Pentest Tools Free
  15. Hacker Tools For Windows
  16. Hacker Tools For Ios
  17. Pentest Tools Kali Linux
  18. Best Pentesting Tools 2018
  19. Nsa Hacker Tools
  20. Tools 4 Hack
  21. Free Pentest Tools For Windows
  22. Pentest Tools For Mac
  23. Pentest Tools
  24. Hack Tools Online
  25. Hacking Tools Windows
  26. Hack Tool Apk No Root
  27. Pentest Tools Free
  28. Pentest Tools Github
  29. Hack Tools
  30. Pentest Tools For Mac
  31. Pentest Tools Alternative
  32. Pentest Tools For Mac
  33. How To Install Pentest Tools In Ubuntu
  34. Hacker Tools
  35. Hacker Tools Apk Download
  36. Hack Tools For Games
  37. Hack Apps
  38. Hack Tools 2019
  39. Pentest Tools For Android
  40. Best Hacking Tools 2019
  41. Hacking Tools Name
  42. Hack Tools For Pc
  43. How To Make Hacking Tools
  44. Pentest Tools For Windows
  45. Hack Tools Download
  46. Hacking Tools Hardware
  47. Hacking Apps
  48. Kik Hack Tools
  49. Hacking Tools For Windows 7
  50. Hacker Tools 2020
  51. Hak5 Tools
  52. Pentest Automation Tools
  53. New Hack Tools
  54. Best Hacking Tools 2020
  55. Hacker Tools Mac
  56. Pentest Tools List
  57. Pentest Tools Website Vulnerability
  58. Hacker Tools Free
  59. New Hacker Tools
  60. Hacking Tools For Windows Free Download
  61. Hack Tools Download
  62. Hacker Tools List
  63. Hack Apps
  64. Hacking Tools Download
  65. Pentest Tools Bluekeep
  66. Hacker Tools Windows
  67. Tools For Hacker
  68. Hack Tools For Ubuntu
  69. Hack Tools Mac
  70. Pentest Tools
  71. Hacking Tools Hardware
  72. Hacker Tools Apk
  73. Hacking Tools Windows
  74. Hack Tools 2019
  75. Hacker
  76. Hacker Techniques Tools And Incident Handling
  77. Hack Tools For Windows
  78. Game Hacking
  79. Hack Tools Mac
  80. Hack Tools 2019
  81. Hacker Tools For Pc
  82. Game Hacking
  83. Install Pentest Tools Ubuntu
  84. Tools For Hacker
  85. Pentest Tools Review
  86. Pentest Tools Website
  87. Pentest Tools Bluekeep
  88. Hack Tools Download
  89. Best Hacking Tools 2020
  90. Hack Tools For Windows
  91. Termux Hacking Tools 2019
  92. Hacker Tools Software
  93. World No 1 Hacker Software
  94. Hacking Tools Name
  95. Hacker Tools For Mac
  96. Hacker Tools 2020
  97. Hacker Tools Apk
  98. Hack Tools 2019
  99. How To Hack
  100. How To Install Pentest Tools In Ubuntu

No hay comentarios: