arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2412.16343cs.CR
收藏

煤矿中还需要金丝雀吗?测量影子栈在对抗栈溢出攻击中的有效性

Do we still need canaries in the coal mine? Measuring shadow stack effectiveness in countering stack smashing

Hugo Depuydt, Merve Gülmez, Thomas Nyman, Jan Tobias Mühlberg

AI总结:

本文基于Juliet测试套件评估x86-64系统中栈金丝雀与影子栈对栈溢出的防护效果,发现影子栈结合类栈保护器布局优于栈金丝雀,并据此改进了Clang影子栈插桩以提升检测准确率。

摘要:

栈金丝雀和影子栈是广泛部署的内存安全漏洞缓解措施。栈金丝雀由编译器引入,依赖放置在变量和控制数据之间的哨兵值;而影子栈实现则显式保护返回地址,并依赖现代处理器设计中可用的硬件特性以提高效率。在本文中,我们假设栈金丝雀和影子栈针对顺序的基于栈的溢出提供相似级别的保护。基于 Juliet 测试套件,我们评估 64 位 x86 (x86-64) 系统在 x86-64 影子栈强制执行之外启用栈金丝雀是否会受益。我们观察到 GCC 和 Clang 编译器之间以及不同优化级别下溢出检测率存在差异,我们将其归因于编译器生成的栈布局差异。我们还发现,当与类似栈保护器的栈布局结合使用时,x86-64 影子栈实现更有效,且优于栈金丝雀。基于此观察,我们实现并评估了对 Clang x86-64 影子栈插桩的增强,提高了影子栈检测准确性。

英文摘要:

Stack canaries and shadow stacks are widely deployed mitigations to memory-safety vulnerabilities. While stack canaries are introduced by the compiler and rely on sentry values placed between variables and control data, shadow stack implementations protect return addresses explicitly and rely on hardware features available in modern processor designs for efficiency. In this paper we hypothesize that stack canaries and shadow stacks provide similar levels of protections against sequential stack-based overflows. Based on the Juliet test suite, we evaluate whether 64-bit x86 (x86-64) systems benefit from enabling stack canaries in addition to the x86-64 shadow stack enforcement. We observe divergence in overflow detection rates between the GCC and Clang compilers and across optimization levels, which we attribute to differences in stack layouts generated by the compilers. We also find that x86-64 shadow stack implementations are more effective and outperform stack canaries when combined with a stack-protector-like stack layout. We implement and evaluate an enhancement to the Clang x86-64 shadow stack instrumentation that improves the shadow stack detection accuracy based on this observation.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑