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 条
  • [1] Function-call Network Reliability of Kernel in Android Operating System
    Sun, Pengfei
    lai, ZhongDe
    Yao, Anzhuo
    Yang, Shunkun
    Li, Daqing
    2019 IEEE INTERNATIONAL SYMPOSIUM ON CIRCUITS AND SYSTEMS (ISCAS), 2019,
  • [2] CHILDRENS UNDERSTANDING OF THE MITIGATING FUNCTION OF DISCLAIMERS
    BENNETT, M
    JOURNAL OF SOCIAL PSYCHOLOGY, 1990, 130 (01): : 29 - 37
  • [3] Code compaction of an operating system kernel
    He, Haifeng
    Trimble, John
    Perianayagam, Somu
    Debray, Saumya
    Andrews, Gregory
    CGO 2007: INTERNATIONAL SYMPOSIUM ON CODE GENERATION AND OPTIMIZATION, 2007, : 283 - +
  • [4] HYDRA - KERNEL OF A MULTIPROCESSOR OPERATING SYSTEM
    WULF, W
    COHEN, E
    CORWIN, W
    JONES, A
    LEVIN, R
    PIERSON, C
    POLLACK, F
    COMMUNICATIONS OF THE ACM, 1974, 17 (06) : 337 - 345
  • [5] Implementation of an embedded operating system kernel
    Ling, Ming
    Zheng, Kaidong
    Hu, Chen
    Shi, Longxing
    Dianzi Qijian/Journal of Electron Devices, 1999, 22 (04): : 262 - 269
  • [6] Design of a persistent operating system kernel
    Kemikli, E
    Erdogan, N
    MELECON '98 - 9TH MEDITERRANEAN ELECTROTECHNICAL CONFERENCE, VOLS 1 AND 2, 1998, : 1304 - 1307
  • [7] Division of Load for Operating System Kernel
    Seneviratne, Sena
    Witharana, Sanjeeva
    2012 IEEE 6TH INTERNATIONAL CONFERENCE ON INFORMATION AND AUTOMATION FOR SUSTAINABILITY (ICIAFS2012), 2012, : 88 - 94
  • [8] VirtuOS: an operating system with kernel virtualization
    Nikolaev, Ruslan
    Back, Godmar
    SOSP'13: PROCEEDINGS OF THE TWENTY-FOURTH ACM SYMPOSIUM ON OPERATING SYSTEMS PRINCIPLES, 2013, : 116 - 132
  • [9] Operating System Noise in the Linux Kernel
    de Oliveira, Daniel Bristot
    Casini, Daniel
    Cucinotta, Tommaso
    IEEE TRANSACTIONS ON COMPUTERS, 2023, 72 (01) : 196 - 207
  • [10] THE KERNEL TEXT UNDERSTANDING SYSTEM
    PALMER, MS
    PASSONNEAU, RJ
    WEIR, C
    FININ, T
    ARTIFICIAL INTELLIGENCE, 1993, 63 (1-2) : 17 - 68