Monday, June 05, 2023

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. Hacking Tools Download
  2. Pentest Tools Open Source
  3. Free Pentest Tools For Windows
  4. Hacking Tools Windows 10
  5. Hack Tools
  6. Best Hacking Tools 2019
  7. Computer Hacker
  8. Pentest Tools Apk
  9. Pentest Tools Open Source
  10. Hacking Tools For Games
  11. Hacker Tools Github
  12. Hack Tools For Games
  13. Hacker Tools Hardware
  14. Hack Tools For Windows
  15. Hack Tools For Ubuntu
  16. Pentest Tools Framework
  17. Hack Tools
  18. Hacker Security Tools
  19. Pentest Tools Url Fuzzer
  20. Pentest Reporting Tools
  21. Hacks And Tools
  22. Hacker Tools Linux
  23. Hacking Tools Software
  24. Pentest Tools Android
  25. Hacker Tools Linux
  26. Hacker Tools Software
  27. Pentest Tools Alternative
  28. Hack Tools Online
  29. Hacking Tools 2019
  30. Hacking Tools And Software
  31. Hacking Tools For Pc
  32. Pentest Tools Find Subdomains
  33. Best Hacking Tools 2020
  34. Hacker Tools Online
  35. Pentest Tools Online
  36. Hacker Tools
  37. Hacker
  38. Nsa Hacker Tools
  39. What Is Hacking Tools
  40. Hacker Tools For Windows
  41. Hacking Tools Hardware
  42. How To Install Pentest Tools In Ubuntu
  43. Pentest Tools Review
  44. Install Pentest Tools Ubuntu
  45. Hacker Tools Free Download
  46. World No 1 Hacker Software
  47. Hack Tools For Ubuntu
  48. Hacking Tools 2019
  49. Hacker Tools 2019
  50. Hacker Hardware Tools
  51. Pentest Tools Nmap
  52. Pentest Reporting Tools
  53. Wifi Hacker Tools For Windows
  54. Hacker
  55. Hacker Tool Kit
  56. Hack Tools Github
  57. Hack Tools Download
  58. Hacker Tools Mac
  59. Hacker
  60. Hacking Tools For Games
  61. How To Hack
  62. Hack Tools Download
  63. Hacking Tools And Software
  64. Hacker Tool Kit
  65. Hacking Tools For Games
  66. Pentest Tools Download
  67. Underground Hacker Sites
  68. Hack Tools
  69. Growth Hacker Tools
  70. Pentest Box Tools Download
  71. Best Pentesting Tools 2018
  72. How To Install Pentest Tools In Ubuntu
  73. Hacker Tools Windows
  74. Pentest Tools Alternative
  75. Pentest Tools Kali Linux
  76. Hack Tools For Ubuntu
  77. Blackhat Hacker Tools
  78. Hak5 Tools
  79. Beginner Hacker Tools
  80. Free Pentest Tools For Windows
  81. Pentest Reporting Tools
  82. Hacker Tools
  83. What Are Hacking Tools
  84. Growth Hacker Tools
  85. Hacker Tools For Ios
  86. Pentest Tools Review
  87. Best Pentesting Tools 2018
  88. New Hacker Tools
  89. Pentest Tools Linux
  90. Best Pentesting Tools 2018
  91. Hacker Hardware Tools

0 Comments:

Post a Comment

<< Home