miércoles, 24 de enero de 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.

Related links
  1. Install Pentest Tools Ubuntu
  2. Hacking Tools Hardware
  3. Tools 4 Hack
  4. Hacking Tools Mac
  5. Best Hacking Tools 2020
  6. Tools 4 Hack
  7. Hacking Tools Software
  8. Pentest Tools For Windows
  9. Hacking Tools And Software
  10. Hacking Tools Kit
  11. Bluetooth Hacking Tools Kali
  12. Hacking Tools For Windows
  13. Best Pentesting Tools 2018
  14. Pentest Tools Framework
  15. Hacking Tools Windows
  16. Hacker Tools Free Download
  17. Hack Tools For Ubuntu
  18. Hacker Tools Free Download
  19. Pentest Tools Download
  20. Hacks And Tools
  21. Hacker Tools 2019
  22. Hacking Tools Free Download
  23. Hack Tools Download
  24. Pentest Tools
  25. Pentest Tools
  26. Free Pentest Tools For Windows
  27. Pentest Tools Kali Linux
  28. Hacker Tools For Ios
  29. Hacking Tools Usb
  30. Android Hack Tools Github
  31. Hacking Tools Hardware
  32. Pentest Tools Website
  33. Hacking Tools For Kali Linux
  34. Hacking Tools Github
  35. Pentest Recon Tools
  36. Hack Tools For Games
  37. Hacking Tools For Beginners
  38. Hacking Tools Github
  39. Hack Tools Github
  40. Pentest Tools For Android
  41. Free Pentest Tools For Windows
  42. Physical Pentest Tools
  43. Hacking Tools Hardware
  44. How To Make Hacking Tools
  45. Hack Website Online Tool
  46. Hack Tools For Pc
  47. Best Pentesting Tools 2018
  48. Hacking Tools For Windows
  49. Hacker Tools 2019
  50. Hacker Security Tools
  51. Hacking Tools Mac
  52. Pentest Automation Tools
  53. Wifi Hacker Tools For Windows
  54. Hacking Tools For Kali Linux
  55. Hak5 Tools
  56. Hak5 Tools
  57. How To Install Pentest Tools In Ubuntu
  58. Hack Tools
  59. Hacking Tools Hardware
  60. Hacking Tools Windows 10
  61. Hack Tools
  62. Hack Apps
  63. Hack Tools Github
  64. Hacking Tools 2020
  65. Hacking Tools For Windows Free Download
  66. Hacking Tools Github
  67. Hacking Tools For Windows Free Download
  68. Pentest Tools Free
  69. Hacker Tools List
  70. Pentest Tools Subdomain
  71. Hacker Tools For Windows
  72. Hacking Tools For Windows Free Download
  73. Pentest Tools Android
  74. Hack Tools For Games
  75. Hack Tools For Pc
  76. Hak5 Tools
  77. Nsa Hack Tools
  78. Install Pentest Tools Ubuntu
  79. Pentest Tools Website Vulnerability
  80. Hacker Tool Kit
  81. Hacking App
  82. Hacking Tools For Mac
  83. Pentest Tools

No hay comentarios:

Publicar un comentario