Understanding and Mitigating Twin Function Misuses in Operating System Kernel

被引:1
|
作者
Gu, Jinyu [1 ]
Shi, Jiacheng [1 ]
Su, Haroran [1 ]
Li, Wentai [1 ]
Zang, Binyu [1 ]
Guan, Haibing [1 ]
Chen, Haibo [1 ]
机构
[1] Shanghai Jiao Tong Univ, Shanghai Key Lab Scalable Comp & Syst, Shanghai 200240, Peoples R China
关键词
Kernel API misusing; kernel bug hunting;
D O I
10.1109/TC.2023.3240365
中图分类号
TP3 [计算技术、计算机技术];
学科分类号
0812 ;
摘要
Major operating system kernels expose twin functions, which are groups of internal primitives that have mostly common but slightly diverging semantics, to kernel modules and subsystems. They are created to make the basic primitives work well in various scenarios. Unfortunately, though being expected as solutions, twin functions may turn to problem-makers in practice. As we have observed from over 500 patches applied to upstream Linux and FreeBSD, developers choose an improper one from the twins, leaving the kernel with stability and security bugs as well as error-prone code. In this paper, we aim to understand and mitigate the twin function misuse problem. First, we provide an informative discussion on the misuse-fix patches. We find that violating the constraints from calling context, missing the primitives with better performance, lacking the necessary security enhancements, and breaking the kernel coding style are the four major factors that lead to misuse. We then identify the programming rules from the patches and apply them with a static program analysis tool extended from Coccinelle, including callgraph tainting and type-based function pointer resolving. We have 136 patches accepted by the Linux community and fix 320 new misuses in the upstream Linux kernel.
引用
收藏
页码:2181 / 2193
页数:13
相关论文
共 50 条
  • [21] Nested Kernel: An Operating System Architecture for Intra-Kernel Privilege Separation
    Dautenhahn, Nathan
    Kasampalis, Theodoros
    Dietz, Will
    Criswell, John
    Adve, Vikram
    ACM SIGPLAN NOTICES, 2015, 50 (04) : 191 - 206
  • [22] Study on the architecture of micro-kernel operating system
    Yang Qiuxiang
    ISTM/2007: 7TH INTERNATIONAL SYMPOSIUM ON TEST AND MEASUREMENT, VOLS 1-7, CONFERENCE PROCEEDINGS, 2007, : 6450 - 6453
  • [23] Applying a usage control model in an operating system kernel
    Teigao, Rafael
    Maziero, Carlos
    Santin, Altair
    JOURNAL OF NETWORK AND COMPUTER APPLICATIONS, 2011, 34 (04) : 1342 - 1352
  • [24] SPECIFICATION OF AN OPERATING SYSTEM KERNEL FOREST AND VDM COMPARED
    GOLDSACK, SJ
    LECTURE NOTES IN COMPUTER SCIENCE, 1988, 328 : 88 - 100
  • [25] Experiences in porting μ-kernel operating system to the CONVEX supercomputer
    Lee, P.C.H.
    Chiang, M.L.
    Hsu, S.T.
    Liu, T.C.
    Chung, W.Y.
    Chang, R.C.
    Journal of Information Science and Engineering, 1996, 12 (02):
  • [26] Bringing AgentX subagents to the operating system kernel space
    Wellnitz, O
    Strauss, F
    SELF-MANAGING DISTRIBUTED SYSTEMS, 2003, 2867 : 234 - 245
  • [27] Microcontroller with ARM Kernel and Real Time Operating System
    Bychkov, Mikhail
    Fedorenko, Artem
    2016 IX INTERNATIONAL CONFERENCE ON POWER DRIVES SYSTEMS (ICPDS), 2016,
  • [28] Synchronization for fast and reentrant operating system kernel tracing
    Desnoyers, Mathieu
    Dagenais, Michel R.
    SOFTWARE-PRACTICE & EXPERIENCE, 2010, 40 (12): : 1053 - 1072
  • [29] Kea - A dynamically extensible and configurable operating system kernel
    Veitch, AC
    Hutchinson, NC
    THIRD INTERNATIONAL CONFERENCE ON CONFIGURABLE DISTRIBUTED SYSTEMS, PROCEEDINGS, 1996, : 236 - 242
  • [30] Security Tagging for a Zero-Kernel Operating System
    Song, Jia
    Alves-Foss, Jim
    PROCEEDINGS OF THE 46TH ANNUAL HAWAII INTERNATIONAL CONFERENCE ON SYSTEM SCIENCES, 2013, : 5049 - 5058