الجمعة، 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.

More information


  1. Kik Hack Tools
  2. Hack Tools Mac
  3. Pentest Tools Alternative
  4. Hacker Tool Kit
  5. Hacker Tools
  6. Tools Used For Hacking
  7. Hackers Toolbox
  8. Pentest Tools Kali Linux
  9. Pentest Tools Android
  10. Hacker Search Tools
  11. Best Hacking Tools 2019
  12. Nsa Hack Tools Download
  13. Termux Hacking Tools 2019
  14. Pentest Reporting Tools
  15. Pentest Tools Subdomain
  16. Hack App
  17. Hacker Techniques Tools And Incident Handling
  18. Hacking Tools Windows
  19. Nsa Hacker Tools
  20. Hacker Tools Apk
  21. Hack Apps
  22. Hacker Tools Windows
  23. Hacker Tools
  24. Blackhat Hacker Tools
  25. Hacking Tools Mac
  26. Hacker Techniques Tools And Incident Handling
  27. Computer Hacker
  28. Best Pentesting Tools 2018
  29. Pentest Tools Website
  30. Hacker Tools Free
  31. Hacker Tools Hardware
  32. Ethical Hacker Tools
  33. Hacker Techniques Tools And Incident Handling
  34. Pentest Tools Kali Linux
  35. Hacking Tools Mac
  36. Hack Tools For Mac
  37. Hack Tool Apk
  38. Hack Tools Download
  39. Pentest Tools Website Vulnerability
  40. Pentest Tools Linux
  41. Pentest Tools Nmap
  42. Hacking Tools Kit
  43. Hacker Tools Software
  44. Hack Apps
  45. Pentest Tools Linux
  46. How To Install Pentest Tools In Ubuntu
  47. Hack Tools Pc
  48. Hacking Tools Mac
  49. Install Pentest Tools Ubuntu
  50. Best Pentesting Tools 2018
  51. Pentest Tools Free
  52. Hacking Tools Kit
  53. Hacking Tools Free Download
  54. Hacker Tools Mac

ليست هناك تعليقات:

إرسال تعليق