What is the use of -fno-stack-protector?

前端 未结 5 1683
[愿得一人]
[愿得一人] 2020-12-29 04:08

I have written an application in C, and I\'m trying to understand what is the purpose of the -fno-stack-protector command when compiling. For my specific applic

5条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-29 04:14

    There are three reasons why you may want to turn this off,

    • You're building a shared a library where this may matter and other functions make assumptions about the stack.
    • You're concerned about performance.
    • You want to build vulnerable software. This very frequently happens with Capture The Flag (CTFs) and the like, as in the case if you wanted to build Protostar to demonstrate an exploit that you wouldn't otherwise be vulnerable too.

提交回复
热议问题