GCC 3.4.3 选项 -fstack-protector-all 的替代品?

发布于 2024-12-21 01:57:02 字数 282 浏览 3 评论 0原文

我正在尝试在 GCC 3.4.3 编译器中设置选项 -fstack-protector-all 以启用某些堆栈粉碎保护方案。然而,当用这个编译时,我得到了
错误:无法识别的命令行选项“-fstack-protector-all” 。看来这个选项没有在 GCC 3.4.3 中实现?或者我错过了什么?

如果它没有在较旧的 GCC 编译器中实现,那么最好/最简单的替代方案是什么?

或者也许一些有用的代码模式可以在 C 代码本身中实现堆栈粉碎保护器?

谢谢

I'm trying to set option -fstack-protector-all in GCC 3.4.3 compiler for enabling some stack smashing protection scenarios. However when compiling with this i got
error: unrecognized command line option "-fstack-protector-all"
. So seems this option isn't implemented in GCC 3.4.3 ?? or Am I missing something ?

If it is not implemented in older GCC compiler what is the best / easiest alternative to this ?

Or maybe some useful code pattern to implement stack-smashing protector in C code itself ?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

静若繁花 2024-12-28 01:57:02

你似乎只是 gcc 版本的一个小版本,它似乎能够为你提供这种特殊的粉碎保护。我在谷歌搜索时发现了这一点:

http://www.research.ibm.com/ trl/projects/security/ssp/

也许您可以升级到该版本(向上一个次要版本)并且仍然与您的供应商兼容?

此外,由于至少多年来金丝雀值在 gcc 中默认设置(无需使用您提到的选项),您是否看过一个简单程序的反汇编?如果您看到从堆栈末尾附近的 (gs) 位置进行了一些存储/加载,则它已经实现了。

You seem to be only one minor version off a gcc version that seems to be able to provide you with this particular smash protection. I found this when googling:

http://www.research.ibm.com/trl/projects/security/ssp/

Maybe you could upgrade to that one (one minor number up) and still be compatible with your vendor?

Additionally, as at least for a number of years canary values are default set in gcc (no need to use the option you mention), have you looked at the disassembly of a simple program? If you see some storing/loading from a (gs) location near end of stack, it's already implemented.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文