Tuesday, May 30, 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.

Related posts


  1. Hak5 Tools
  2. Hacker Tools For Mac
  3. Computer Hacker
  4. Hack Tools Pc
  5. Hacker Tools Free Download
  6. Pentest Tools Github
  7. Underground Hacker Sites
  8. Hacker Tools Software
  9. New Hack Tools
  10. Pentest Tools Website
  11. Hack Tools For Pc
  12. Pentest Tools Port Scanner
  13. Hacking Tools Pc
  14. Pentest Tools Free
  15. Pentest Tools Download
  16. Easy Hack Tools
  17. Hack And Tools
  18. Pentest Tools Open Source
  19. Hacker Tools Free Download
  20. Hacker Tool Kit
  21. Hacking Tools Online
  22. Best Hacking Tools 2020
  23. Hacking Tools For Windows
  24. Nsa Hack Tools Download
  25. Hacking Tools And Software
  26. Pentest Tools Free
  27. Hack And Tools
  28. Hackers Toolbox
  29. Pentest Tools Apk
  30. Pentest Tools Android
  31. Hack Tools 2019
  32. Hacking Tools Windows 10
  33. Bluetooth Hacking Tools Kali
  34. Hak5 Tools
  35. Hack Tools Github
  36. Hacker Tools Online
  37. Hacking Tools 2019
  38. Hacker Tools Linux
  39. Hacker Tools Hardware
  40. Pentest Automation Tools
  41. Hacking Tools And Software
  42. Hacker Hardware Tools
  43. Hackers Toolbox
  44. Wifi Hacker Tools For Windows
  45. Black Hat Hacker Tools
  46. Pentest Tools Tcp Port Scanner
  47. Hack Tools
  48. Pentest Tools For Android
  49. New Hacker Tools
  50. Hacker Tools Windows
  51. Hacker Tools Windows
  52. Hack Tool Apk No Root
  53. Hacking Tools 2020
  54. Tools Used For Hacking
  55. Android Hack Tools Github
  56. Hack Tools For Mac
  57. Kik Hack Tools
  58. Best Pentesting Tools 2018
  59. Hack Tools For Windows
  60. Hacking Tools Mac
  61. Hacking Tools Windows 10
  62. Hacking Tools 2020
  63. Hacker Security Tools
  64. Hacking App
  65. Hacking Tools For Games
  66. Hacking Tools For Windows Free Download
  67. Pentest Tools Free
  68. Pentest Tools List
  69. Free Pentest Tools For Windows
  70. Hack Tools For Mac
  71. Hacking App
  72. Pentest Tools Online
  73. Computer Hacker
  74. Hacker Search Tools
  75. Hack Tools For Ubuntu
  76. Hacking Tools For Windows 7
  77. Hacking Tools Online
  78. Pentest Tools For Ubuntu
  79. Hacker Tools Windows

No comments:

Post a Comment