Thursday, June 1, 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 word


  1. Hacker Tools Online
  2. What Are Hacking Tools
  3. Top Pentest Tools
  4. Blackhat Hacker Tools
  5. Pentest Recon Tools
  6. Hacking Tools Usb
  7. Hack App
  8. Hacker Tools For Pc
  9. Pentest Tools Apk
  10. Hacker Tools Windows
  11. Hak5 Tools
  12. Hack Tools For Pc
  13. Hacking Tools Kit
  14. Hack Tools For Pc
  15. Computer Hacker
  16. Nsa Hacker Tools
  17. Hacker Tools Linux
  18. Hackrf Tools
  19. Hacker Tools For Pc
  20. Hacking Tools Pc
  21. Hacker Techniques Tools And Incident Handling
  22. Easy Hack Tools
  23. Hacker Tools 2019
  24. Github Hacking Tools
  25. Hacking Tools Windows
  26. Hacker Techniques Tools And Incident Handling
  27. Beginner Hacker Tools
  28. Pentest Tools Find Subdomains
  29. Hacker Tools For Ios
  30. Hack Tools For Games
  31. Hack App
  32. Hacking Tools
  33. Hacking Tools Online
  34. Hacker Tools Software
  35. Hacking Tools Hardware
  36. Pentest Automation Tools
  37. Easy Hack Tools
  38. New Hack Tools
  39. Hacking Tools Kit
  40. Hack Tools Mac
  41. Android Hack Tools Github
  42. Hack And Tools
  43. Hacking Tools 2020
  44. How To Make Hacking Tools
  45. Hacker Tools Apk
  46. Hacker Tools Hardware
  47. Hacker Tools
  48. Hak5 Tools
  49. Pentest Tools Bluekeep
  50. Beginner Hacker Tools
  51. Hacking Tools 2019
  52. Usb Pentest Tools
  53. Physical Pentest Tools
  54. Growth Hacker Tools
  55. Hacking Tools 2019
  56. Blackhat Hacker Tools
  57. Hack App
  58. Hacker Security Tools
  59. Hacker Search Tools
  60. Hacking Tools Pc
  61. Hacker Tools Apk
  62. Hacking Tools For Windows
  63. Black Hat Hacker Tools
  64. Hacking Apps
  65. Pentest Tools Open Source
  66. Beginner Hacker Tools
  67. Tools 4 Hack
  68. Hacking Apps
  69. Pentest Tools Apk
  70. Hacker Tools List
  71. Hacker Tools Mac
  72. Hacking Tools Download
  73. Free Pentest Tools For Windows
  74. Hacker Tools Windows
  75. Nsa Hack Tools
  76. Hacking Tools And Software

No comments:

Post a Comment