CLICK HERE FOR BLOGGER TEMPLATES AND MYSPACE LAYOUTS »

Thursday, August 20, 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. Physical Pentest Tools
  2. Pentest Tools Linux
  3. Pentest Tools Kali Linux
  4. Hack Apps
  5. Blackhat Hacker Tools
  6. Pentest Tools
  7. Hacker Tools Windows
  8. Pentest Tools Open Source
  9. Pentest Tools For Mac
  10. Hacker Tools Hardware
  11. Hacking Tools Online
  12. Hack Tools For Windows
  13. Github Hacking Tools
  14. Ethical Hacker Tools
  15. Hack Tools For Games
  16. Hacking Tools Download
  17. Hacks And Tools
  18. Hack Tools
  19. Hack Tools Online
  20. Hacker Tools List
  21. Hacker Tools Free
  22. Pentest Tools For Mac
  23. Pentest Tools Url Fuzzer
  24. Hak5 Tools
  25. Hacking Tools
  26. Hack Tools
  27. Hack Tools For Pc
  28. Pentest Tools Free
  29. Hacking Tools And Software
  30. Hacker Tools Linux
  31. Hacking Tools Download
  32. Hack Rom Tools
  33. Blackhat Hacker Tools
  34. Hacking Tools For Games
  35. Hacks And Tools
  36. Hacking Tools Kit
  37. Hacker Tools For Mac
  38. Hacker Tools For Windows
  39. Pentest Reporting Tools
  40. What Is Hacking Tools
  41. Wifi Hacker Tools For Windows
  42. Pentest Automation Tools
  43. Pentest Tools Open Source
  44. Hacker Tools For Ios
  45. Hack Tools
  46. Hack Tools For Ubuntu
  47. Pentest Tools For Mac
  48. Hack Tools For Games
  49. Pentest Tools For Android
  50. Hacking Tools For Windows Free Download
  51. Pentest Recon Tools
  52. Hacking Tools Hardware
  53. New Hack Tools
  54. Pentest Tools Linux
  55. Free Pentest Tools For Windows
  56. Hackrf Tools
  57. Kik Hack Tools
  58. Hacking Tools Kit
  59. New Hacker Tools
  60. Install Pentest Tools Ubuntu
  61. What Is Hacking Tools
  62. Hacking Tools For Windows Free Download
  63. Pentest Tools Review
  64. Hack Rom Tools
  65. Game Hacking

0 comments: