计算机科学 ›› 2026, Vol. 53 ›› Issue (8): 446-454.doi: 10.11896/jsjkx.250600180
樊宇豪1, 孙聪1, 张淋茂2
FAN Yuhao1, SUN Cong1, ZHANG Linmao2
摘要: Linux系统setuid机制允许用户临时提升程序权限,但这一机制违背了最小特权原则。一旦此类程序存在漏洞,攻击者就可利用其权限实现提权,导致严重后果。为降低风险,Linux引入了能力机制,将root权限分散到一组细粒度的能力中,按需分配能力。现有基于系统调用识别的能力限制方案在赋予程序真正需要的能力子集时仍存在缺陷:一方面,由于未过滤动态库冗余代码及对Glibc库函数调用图分析不精确,得到的系统调用集过近似;另一方面,对系统调用的参数分析不准确,导致对程序需要的能力估计较保守。对此,提出了一种基于代码专门化的程序能力限制方案。方案对程序依赖的二进制动态库进行裁剪,减少冗余库代码对系统调用识别的影响;结合动态库裁剪结果对Glibc调用图进行修剪和系统调用分析,得到更精确的程序特定系统调用集。进一步地,对裁剪后的程序特定的动态库进行后向迭代数据流分析,提取特定系统调用的敏感参数值,依据程序特定系统调用集和敏感参数值得到程序需要的精确能力集。对于具体的二进制程序,在实现以上分析的基础上,依据分析得到的精确能力集和系统调用集对二进制程序进行限制,减少程序能够执行的特权操作。实验结果表明,所提方法相比现有方案,系统调用识别更精确,能实现更强的程序能力限制,在setuid程序上能够显著减小攻击面并缓解特权升级漏洞。
中图分类号:
| [1] GREGG B.Linux bcc Tracing Security Capabilities[EB/OL].(2016-10-01)[2025-05-17].https://www.brendangregg.com/blog/2016-10-01/linux-bcc-security-capabilities.html. [2] KANG H,KIM J,SHIN S.MiniCon:Automatic Enforcement of a Minimal Capability Set for Security-Enhanced Containers[C]//Proceedings of the IEEE International IoT,Electronics and Mechatronics Conference.IEEE,2021:1-5. [3] HASAN M M,GHAVAMNIA S,POLYCHRONAKIS M.Decap:Deprivileging Programs by Reducing Their Capabilities[C]//Proceedings of the 25th International Symposium on Research in Attacks,Intrusions and Defenses.ACM,2022:395-408. [4] DEMARINIS N,WILLIAMS-KING K,JIN D,et al.Sysfilter:Automated System Call Filtering for Commodity Software[C]//Proceedings of the 23rd International Symposium on Research in Attacks,Intrusions and Defenses.ACM,2020:459-474. [5] GHAVAMNIA S,PALIT T,BENAMEUR A,et al.Confine:Automated System Call Policy Generation for Container Attack Surface Reduction[C]//Proceedings of the 23rd International Symposium on Research in Attacks,Intrusions and Defenses.ACM,2020:443-458. [6] KERRISK M.CAP_SYS_ADMIN:the new root[EB/OL].(2012-02-15)[2025-05-17].https://lwn.net/Articles/486306/. [7] ZHANG L M,SUN C,RAO X.Dynamic Library Debloating Enhanced System Call Restriction of Programs[J].Computer Science,2025,52(7):50-57. [8] GHAVAMNIA S,PALIT T,MISHRA S,et al.Temporal System Call Specialization for Attack Surface Reduction[C]//Proceedings of the 29th USENIX Security Symposium.USENIX Association,2020:1749-1766. [9] RAJAGOPALAN V L,KLEFTOGIORGOS K,GOKTAS E,et al.SysPart:Automated Temporal System Call Filtering for Binaries[C]//Proceedings of the 2023 ACM SIGSAC Conference on Computer and Communications Security.ACM,2023:1979-1993. [10] GAIDIS A J,ATLIDAKIS V,KEMERLIS V P.SysXCHG:Refining Privilege with Adaptive System Call Filters[C]//Proceedings of the 2023 ACM SIGSAC Conference on Computer and Communications Security.ACM,2023:1964-1978. [11] Musl Libc[EB/OL].2024[2025-05-17].https://musl.libc.org/. [12] HU X Y,ZHOU J,GRAVANI S,et al.Transforming Code to Drop Dead Privileges[C]//Proceedings of the 2018 IEEE Cybersecurity Development.IEEE,2018:45-52. [13] SUN M H,SONG Z R,REN XX,et al.LiCA:A Fine-Grained and Path-Sensitive Linux Capability Analysis Framework[C]//Proceedings of the 25th International Symposium on Research in Attacks,Intrusions and Defenses.2022:364-379. [14] VAN DER VEEN V,GOKTAS E,CONTAG M,et al.A Tough Call:Mitigating Advanced Code-Reuse Attacks at the Binary Level[C]//Proceedings of 2016 IEEE Symposium on Security and Privacy.IEEE,2016:934-953. [15] ANDERSEN L O.Program analysis and specialization for the C programming language[D].Copenhagen:University of Cophenhagen,1994. [16] HIND M.Pointer Analysis:Haven’t We Solved This ProblemYet?[C]//Proceedings of the ACM SIGPLAN/SIGSOFT Workshop on Program Analysis for Software Tools and Engineering.ACM,2001:54-61. [17] SUI Y L,XUE J L.SVF:Interprocedural Static Value-Flow Analysis in LLVM[C]//Proceedings of the 25th International Conference on Compiler Construction.ACM,2016:265-266. [18] LUK C K,COHN R,MUTH R,et al.Pin:Building Customized Program Analysis Tools with Dynamic Instrumentation[J].ACM SIGPLAN Notices,2005,40(6):190-200. |
|
||