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 条
  • [11] AIT: A method for operating system kernel function call graph generation with a virtualization technique
    Jiao, Longlong
    Luo, Senlin
    Liu, Wangtong
    Pan, Limin
    KSII TRANSACTIONS ON INTERNET AND INFORMATION SYSTEMS, 2020, 14 (05): : 2084 - 2100
  • [12] THE KERNEL OF THE EMAS-2900 OPERATING SYSTEM
    REES, DJ
    STEPHENS, PD
    SOFTWARE-PRACTICE & EXPERIENCE, 1982, 12 (07): : 655 - 667
  • [13] TOSKANA: A toolkit for operating system kernel aspects
    Engel, Michael
    Freisleben, Bernd
    TRANSACTIONS ON ASPECT-ORIENTED SOFTWARE DEVELOPMENT II, 2006, 4242 : 182 - 226
  • [14] Ensuring Operating System Kernel Integrity with OSck
    Hofmann, Owen S.
    Dunn, Alan M.
    Kim, Sangman
    Roy, Indrajit
    Witchel, Emmett
    ACM SIGPLAN NOTICES, 2011, 46 (03) : 279 - 290
  • [15] Tiny Operating System Kernel for Education Purposes
    Ribic, Samir
    Salihbegovic, Adnan
    2015 8TH INTERNATIONAL CONVENTION ON INFORMATION AND COMMUNICATION TECHNOLOGY, ELECTRONICS AND MICROELECTRONICS (MIPRO), 2015, : 700 - 705
  • [16] The RETOS operating system: Kernel, tools and applications
    Cha, Hojung
    Choi, Sukwon
    Jung, Inuk
    Kim, Hyoseung
    Shin, Hyojeong
    Yoo, Jaehyun
    Yoon, Chanmin
    PROCEEDINGS OF THE SIXTH INTERNATIONAL SYMPOSIUM ON INFORMATION PROCESSING IN SENSOR NETWORKS, 2007, : 559 - 560
  • [17] KBT: Operating system kernel level binary translation system
    Jiang, Haitao
    Xu, Yun
    Liao, Yin
    Jin, Guojie
    Chen, Guoliang
    Journal of Software, 2013, 8 (06) : 1275 - 1280
  • [18] Twin Support Vector Machines Based on the Mixed Kernel Function
    Wu, Fulin
    Ding, Shifei
    JOURNAL OF COMPUTERS, 2014, 9 (07) : 1690 - 1696
  • [19] ON THE KERNEL FUNCTION OF AN ORTHONORMAL SYSTEM
    SCHIFFER, M
    BULLETIN OF THE AMERICAN MATHEMATICAL SOCIETY, 1946, 52 (03) : 236 - 236
  • [20] THE KERNEL FUNCTION OF AN ORTHONORMAL SYSTEM
    SCHIFFER, M
    DUKE MATHEMATICAL JOURNAL, 1946, 13 (04) : 529 - 540