Friday, January 19, 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.

Read more


  1. Hacks And Tools
  2. Pentest Tools Url Fuzzer
  3. Hacking Tools Download
  4. Pentest Tools Url Fuzzer
  5. Pentest Tools
  6. Bluetooth Hacking Tools Kali
  7. Pentest Tools For Windows
  8. Hack Tools For Ubuntu
  9. Hacking Tools For Mac
  10. Hack Tool Apk
  11. Computer Hacker
  12. Hacking Tools Usb
  13. Pentest Tools For Windows
  14. Pentest Tools Online
  15. Pentest Tools Website
  16. Tools For Hacker
  17. New Hack Tools
  18. Pentest Tools Alternative
  19. Hacker Tools Windows
  20. Hacker Tools Hardware
  21. Hack Tool Apk
  22. Hack Tools For Mac
  23. Hacker Tools Hardware
  24. Hacking Tools Github
  25. Top Pentest Tools
  26. Pentest Recon Tools
  27. Hacker Tools Windows
  28. Hack Tool Apk No Root
  29. Pentest Tools For Windows
  30. Pentest Tools Tcp Port Scanner
  31. Black Hat Hacker Tools
  32. Hack Tools Pc
  33. Hacking Tools Online
  34. Hacking Tools Name
  35. Hack Tools For Windows
  36. Hacker Search Tools
  37. Hack Tools For Pc
  38. Hacking Tools For Games
  39. How To Hack
  40. Pentest Tools Download
  41. Hacking Tools Mac
  42. Hacking Tools Mac
  43. Nsa Hacker Tools
  44. Hack Tools For Games
  45. Usb Pentest Tools
  46. Hacker Hardware Tools
  47. Hack Tool Apk
  48. Nsa Hack Tools Download
  49. Hacking Tools Pc
  50. Hack Tools Download
  51. Hacking Tools Windows
  52. Termux Hacking Tools 2019
  53. Pentest Tools Framework

No comments:

Post a Comment