Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/3372297.3417256acmconferencesArticle/Chapter ViewAbstractPublication PagesccsConference Proceedingsconference-collections
research-article

Exaggerated Error Handling Hurts! An In-Depth Study and Context-Aware Detection

Published: 02 November 2020 Publication History

Abstract

Operating system (OS) kernels frequently encounter various errors due to invalid internal states or external inputs. To ensure the security and reliability of OS kernels, developers propose a diverse set of mechanisms to conservatively capture and handle potential errors. Existing research has thus primarily focused on the completeness and adequacy of error handling to not miss the attention. However, we find that handling an error with an over-severe level (e.g., unnecessarily terminating the execution) instead hurts the security and reliability. In this case, the error-handling consequences are even worse than the error it attempts to resolve. We call such a case Exaggerated Error Handling (EEH). The security impacts of EEH bugs vary, including denial-of-service, data losses, broken control-flow integrity, memory leaks, etc. Despite its significance, detecting EEH remains an unexplored topic.
In this paper, we first conduct an in-depth study on EEH. Based on the findings of the study, we then propose an approach, EeCatch, to detect EEH bugs in a context-aware manner. EeCatch accurately identifies errors and extracts their contexts (both spatial and temporal), and automatically infers the appropriate severity level for error handling. Using the inferred severity level, EeCatch finally detects EEH bugs in which the used error handling exceeds the inferred severity level. By analyzing the whole Linux kernel, EeCatch reports hundreds of potential EEH bugs that may cause security issues such as crashing the system. After evaluating 104 cases reported by EeCatch, we manually confirmed 64 EEH bugs and submitted patches for all of them. Using our patches, Linux maintainers have fixed 48 reported EEH bugs, confirming the effectiveness of EeCatch. To the best of our knowledge, we are the first to systematically study and detect EEH bugs. We hope the findings could raise the awareness of the critical consequences of EEH bugs to help developers avoid them.

Supplementary Material

MOV File (Copy of CCS2020_fp208_Aditya Pakki - Andrew Diehl.mov)
Presentation video

References

[1]
Mithun Acharya and Tao Xie. 2009. Mining API error-handling specifications from source code. In International Conference on Fundamental Approaches to Software Engineering. Springer, 370--384.
[2]
Johannes Bader, Andrew Scott, Michael Pradel, and Satish Chandra. 2019. Getafix: Learning to fix bugs automatically. Proceedings of the ACM on Programming Languages, Vol. 3, OOPSLA (2019), 1--27.
[3]
Jia-Ju Bai, Julia Lawall, Wende Tan, and Shi-Min Hu. 2019. DCNS: Automated Detection Of Conservative Non-Sleep Defects in the Linux Kernel. In Proceedings of the Twenty-Fourth International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS '19). ACM, New York, NY, USA, 287--299. https://doi.org/10.1145/3297858.3304065
[4]
Marcel Böhme, Van-Thuan Pham, Manh-Dung Nguyen, and Abhik Roychoudhury. 2017. Directed greybox fuzzing. In Proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications Security. ACM, 2329--2344.
[5]
Pete Broadwell, Naveen Sastry, and Jonathan Traupman. 2002. FIG: A prototype tool for online verification of recovery mechanisms. In Workshop on Self-Healing, Adaptive and Self-Managed Systems. Citeseer.
[6]
Dan Carpenter. 2009. Smatch - the source matcher. http://smatch.sourceforge.
[7]
Aaron Ceglar and John F Roddick. 2006. Association mining. ACM Computing Surveys (CSUR), Vol. 38, 2 (2006), 5.
[8]
Vitaly Chipounov, Volodymyr Kuznetsov, and George Candea. 2011. S2E: A Platform for In-vivo Multi-path Analysis of Software Systems. SIGPLAN Not., Vol. 47, 4 (March 2011), 265--278. https://doi.org/10.1145/2248487.1950396
[9]
Andy Chou, Junfeng Yang, Benjamin Chelf, Seth Hallem, and Dawson Engler. 2001. An empirical study of operating systems errors. In ACM SIGOPS Operating Systems Review, Vol. 35. ACM, 73--88.
[10]
Daniel DeFreez, Aditya V. Thakur, and Cindy Rubio-González. 2018. Path-Based Function Embedding and Its Application to Error-Handling Specification Mining (ESEC/FSE 2018). Association for Computing Machinery, New York, NY, USA.
[11]
EeCatch. 2020. Source code. https://github.com/umnsec/eecatch/.
[12]
Dawson Engler, David Yu Chen, Seth Hallem, Andy Chou, and Benjamin Chelf. 2001. Bugs As Deviant Behavior: A General Approach to Inferring Errors in Systems Code. SIGOPS Oper. Syst. Rev., Vol. 35, 5 (Oct. 2001), 57--72. https://doi.org/10.1145/502059.502041
[13]
Michael D Ernst, Jake Cockrell, William G Griswold, and David Notkin. 2001. Dynamically discovering likely program invariants to support program evolution. IEEE Transactions on Software Engineering, Vol. 27, 2 (2001), 99--123.
[14]
Shuitao Gan, Chao Zhang, Xiaojun Qin, Xuwen Tu, Kang Li, Zhongyu Pei, and Zuoning Chen. 2018. Collafl: Path sensitive fuzzing. In 2018 IEEE Symposium on Security and Privacy (SP). IEEE, 679--696.
[15]
Vijay Ganesh, Tim Leek, and Martin Rinard. 2009. Taint-based directed whitebox fuzzing. In Proceedings of the 31st International Conference on Software Engineering. IEEE Computer Society, 474--484.
[16]
David Gens, Simon Schmitt, Lucas Davi, and Ahmad-Reza Sadeghi. 2018. K-Miner: Uncovering Memory Corruption in Linux. In Proceedings of the 2018 Annual Network and Distributed System Security Symposium (NDSS). San Diego, CA.
[17]
Haryadi S Gunawi, Cindy Rubio-González, Andrea C Arpaci-Dusseau, Remzi H Arpaci-Dusseau, and Ben Liblit. 2008. EIO: Error Handling is Occasionally Correct. In FAST, Vol. 8. 1--16.
[18]
Sean Heelan, Tom Melham, and Daniel Kroening. 2018. Automatic heap layout manipulation for exploitation. In 27th USENIX Security Symposium (USENIX Security 18). 763--779.
[19]
Tetuso Honda. 2017. tty: Avoid possible error pointer dereference at tty_ldisc_restore(). https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=598c2d41ff44889dd8eced4f117403e472158d85.
[20]
Einar W Høst and Bjarte M Østvold. 2009. Debugging method names. In European Conference on Object-Oriented Programming. Springer, 294--317.
[21]
Z. Huang, M. DAngelo, D. Miyani, and D. Lie. 2016. Talos: Neutralizing Vulnerabilities with Security Workarounds for Rapid Response. In 2016 IEEE Symposium on Security and Privacy (SP). 618--635. https://doi.org/10.1109/SP.2016.43
[22]
Z. Jia, S. Li, T. Yu, X. Liao, J. Wang, X. Liu, and Y. Liu. 2019. Detecting Error-Handling Bugs without Error Specification Input. In 2019 34th IEEE/ACM International Conference on Automated Software Engineering (ASE) .
[23]
Yuan Kang, Baishakhi Ray, and Suman Jana. 2016. APEx: Automated inference of error specifications for C APIs. In Proceedings of the 31st IEEE/ACM International Conference on Automated Software Engineering. ACM, 472--482.
[24]
Vasileios P Kemerlis, Michalis Polychronakis, and Angelos D Keromytis. 2014. ret2dir: Rethinking kernel isolation. In 23rd USENIX Security Symposium (USENIX Security 14). 957--972.
[25]
Jean-Claude Laprie. 1995. Dependable computing: Concepts, limits, challenges. In Special issue of the 25th international symposium on fault-tolerant computing. 42--54.
[26]
Chris Lattner and Vikram Adve. 2004. LLVM: A Compilation Framework for Lifelong Program Analysis & Transformation. In Proceedings of the International Symposium on Code Generation and Optimization: Feedback-directed and Runtime Optimization (CGO '04). IEEE Computer Society, 75--.
[27]
Heng Li, Weiyi Shang, and Ahmed E. Hassan. 2017. Which log level should developers choose for a new logging statement? Empirical Software Engineering, Vol. 22, 4 (01 Aug 2017), 1684--1716. https://doi.org/10.1007/s10664-016--9456--2
[28]
Zhenmin Li and Yuanyuan Zhou. 2005. PR-Miner: Automatically Extracting Implicit Programming Rules and Detecting Violations in Large Software Code. SIGSOFT Softw. Eng. Notes, Vol. 30, 5 (Sept. 2005), 306--315. https://doi.org/10.1145/1095430.1081755
[29]
Hui Liu, Qiurong Liu, Cristian-Alexandru Staicu, Michael Pradel, and Yue Luo. 2016. Nomen est omen: Exploring and exploiting similarities between argument and parameter names. In Proceedings of the 38th International Conference on Software Engineering. 1063--1073.
[30]
Kangjie Lu, Aditya Pakki, and Qiushi Wu. 2019 a. Automatically Identifying Security Checks for Detecting Kernel Semantic Bugs. In Computer Security -- ESORICS 2019, Kazue Sako, Steve Schneider, and Peter Y. A. Ryan (Eds.). Springer International Publishing, Cham, 3--25.
[31]
Kangjie Lu, Aditya Pakki, and Qiushi Wu. 2019 b. Detecting Missing-Check Bugs via Semantic- and Context-Aware Criticalness and Constraints Inferences. In 28th USENIX Security Symposium (USENIX Security 19). USENIX Association, Santa Clara, CA, 1769--1786.
[32]
Kangjie Lu, Chengyu Song, Taesoo Kim, and Wenke Lee. 2016. UniSan: Proactive Kernel Memory Initialization to Eliminate Data Leakages. In Proceedings of the 23rd ACM Conference on Computer and Communications Security (CCS). Vienna, Austria.
[33]
Aravind Machiry, Chad Spensky, Jake Corina, Nick Stephens, Christopher Kruegel, and Giovanni Vigna. 2017. DR. CHECKER: A Soundy Analysis for Linux Kernel Drivers. In 26th USENIX Security Symposium (USENIX Security 17). USENIX Association, Vancouver, BC, 1007--1024.
[34]
Paul D. Marinescu, Radu Banabic, and George Candea. 2010. An Extensible Technique for High-Precision Testing of Recovery Code. In Proceedings of the 2010 USENIX Conference on USENIX Annual Technical Conference (USENIX ATC 10). USENIX Association, USA, 23.
[35]
Changwoo Min, Sanidhya Kashyap, Byoungyoung Lee, Chengyu Song, and Taesoo Kim. 2015. Cross-checking Semantic Correctness: The Case of Finding File System Bugs. In Proceedings of the 25th ACM Symposium on Operating Systems Principles (SOSP). Monterey, CA.
[36]
Alon Mishne, Sharon Shoham, and Eran Yahav. 2012. Typestate-based semantic code search over partial programs. In Acm Sigplan Notices, Vol. 47. ACM, 997--1016.
[37]
Ingo Molnar. 2015. Deprecate BUG_ON() use in new code, introduce CRASH_ON(). https://lore.kernel.org/patchwork/patch/568291/.
[38]
OWASP. 2017. OWASP Top 10 - The Ten Most Critical Web Application Security Risks. https://www.owasp.org/images/7/72/OWASP_Top_10--2017_%28en%29.pdf.
[39]
Yoann Padioleau, Julia L. Lawall, René Rydhof Hansen, and Gilles Muller. 2008. Documenting and automating collateral evolutions in linux device drivers. In EuroSys .
[40]
Michael Pradel and Koushik Sen. 2018. DeepBugs: A learning approach to name-based bug detection. Proceedings of the ACM on Programming Languages, Vol. 2, OOPSLA (2018), 147.
[41]
David A. Ramos and Dawson Engler. 2015. Under-Constrained Symbolic Execution: Correctness Checking for Real Code. In Proceedings of the 24th USENIX Security Symposium (Security). Washington, DC.
[42]
Dusan Repel, Johannes Kinder, and Lorenzo Cavallaro. 2017. Modular synthesis of heap exploits. In Proceedings of the 2017 Workshop on Programming Languages and Analysis for Security. ACM, 25--35.
[43]
Andrew Rice, Edward Aftandilian, Ciera Jaspan, Emily Johnston, Michael Pradel, and Yulissa Arroyo-Paredes. 2017. Detecting argument selection defects. Proceedings of the ACM on Programming Languages, Vol. 1, OOPSLA (2017), 1--22.
[44]
Cindy Rubio-González, Haryadi S Gunawi, Ben Liblit, Remzi H Arpaci-Dusseau, and Andrea C Arpaci-Dusseau. 2009. Error propagation analysis for file systems. In ACM Sigplan Notices, Vol. 44. ACM, 270--280.
[45]
Suman Saha, Jean-Pierre Lozi, Gaël Thomas, Julia L Lawall, and Gilles Muller. 2013. Hector: Detecting resource-release omission faults in error-handling code for systems software. In 2013 43rd Annual IEEE/IFIP International Conference on Dependable Systems and Networks (DSN). IEEE, 1--12.
[46]
Martin Susskraut and Christof Fetzer. 2006. Automatically finding and patching bad error handling. In 2006 Sixth European Dependable Computing Conference. IEEE, 13--22.
[47]
Mana Taghdiri and Daniel Jackson. 2007. Inferring specifications to detect errors in code. Automated Software Engineering, Vol. 14, 1 (2007), 87--121.
[48]
Lin Tan, Xiaolan Zhang, Xiao Ma, Weiwei Xiong, and Yuanyuan Zhou. 2008. AutoISES: Automatically Inferring Security Specification and Detecting Violations. In USENIX Security Symposium. 379--394.
[49]
Yuchi Tian and Baishakhi Ray. 2017. Automatically diagnosing and repairing error handling bugs in c. In Proceedings of the 2017 11th Joint Meeting on Foundations of Software Engineering. ACM, 752--762.
[50]
Linus Torvalds. 2007 a. BUG_ON in workingset_node_shadows_dec triggers. https://lkml.org/lkml/2016/10/4/1.
[51]
Linus Torvalds. 2007 b. Do not use BUG. https://yarchive.net/comp/linux/BUG.html.
[52]
Linus Torvalds. 2019. Sparse - a Semantic Parser for C. https://sparse.wiki.kernel.org/index.php/Main_Page.
[53]
Omer Tripp, Salvatore Guarnieri, Marco Pistoia, and Aleksandr Aravkin. 2014. Aletheia: Improving the usability of static security analysis. In Proceedings of the 2014 ACM SIGSAC Conference on Computer and Communications Security. ACM.
[54]
Dmitry Vyukov. 2015. Syzkaller.
[55]
Dmitry Vyukov. 2019. Syzbot and the Tale of Thousand Kernel Bugs. https://events19.linuxfoundation.org/wp-content/uploads/2017/11/Syzbot-and-the-Tale-of-Thousand-Kernel-Bugs-Dmitry-Vyukov-Google.pdf.
[56]
Pengfei Wang, Jens Krinke, Kai Lu, Gen Li, and Steve Dodier-Lazaro. 2017. How Double-Fetch Situations turn into Double-Fetch Vulnerabilities: A Study of Double Fetches in the Linux Kernel. In 26th USENIX Security Symposium (USENIX Security 17). USENIX Association, Vancouver, BC, 1--16.
[57]
Wenwen Wang, Kangjie Lu, and Pen-Chung Yew. 2018. Check It Again: Detecting Lacking-Recheck Bugs in OS Kernels. In Proceedings of the 2018 ACM SIGSAC Conference on Computer and Communications Security. Association for Computing Machinery, New York, NY, USA, 15.
[58]
Meng Xu, Chenxiong Qian, Kangjie Lu, Michael Backes, and Taesoo Kim. 2018. Precise and Scalable Detection of Double-Fetch Bugs in OS Kernels. In Proceedings of the 39th IEEE Symposium on Security and Privacy (Oakland). San Francisco, CA.
[59]
F. Yamaguchi, A. Maier, H. Gascon, and K. Rieck. 2015. Automatic Inference of Search Patterns for Taint-Style Vulnerabilities. In 2015 IEEE Symposium on Security and Privacy. 797--812. https://doi.org/10.1109/SP.2015.54
[60]
Fabian Yamaguchi, Christian Wressnegger, Hugo Gascon, and Konrad Rieck. 2013. Chucky: Exposing missing checks in source code for vulnerability discovery. In Proceedings of the 2013 ACM SIGSAC conference on Computer & communications security. ACM, 499--510.
[61]
Ding Yuan, Yu Luo, Xin Zhuang, Guilherme Renna Rodrigues, Xu Zhao, Yongle Zhang, Pranay U. Jain, and Michael Stumm. 2014. Simple Testing Can Prevent Most Critical Failures: An Analysis of Production Failures in Distributed Data-Intensive Systems. In 11th USENIX Symposium on Operating Systems Design and Implementation (OSDI 14). USENIX Association, Broomfield, CO, 249--265.
[62]
Insu Yun, Changwoo Min, Xujie Si, Yeongjin Jang, Taesoo Kim, and Mayur Naik. 2016. APISan: Sanitizing API Usages through Semantic Cross-Checking. In 25th USENIX Security Symposium (USENIX Security 16). USENIX Association, Austin, TX, 363--378.
[63]
Tong Zhang, Wenbo Shen, Dongyoon Lee, Changhee Jung, Ahmed M Azab, and Ruowen Wang. 2019. Pex: A permission check analysis framework for linux kernel. In 28th USENIX Security Symposium (USENIX Security 19). 1205--1220.

Cited By

View all
  • (2024)Cut to the Chase: An Error-Oriented Approach to Detect Error-Handling BugsProceedings of the ACM on Software Engineering10.1145/36607871:FSE(1796-1818)Online publication date: 12-Jul-2024
  • (2024)Process-Aware Intrusion Detection in MQTT NetworksProceedings of the Fourteenth ACM Conference on Data and Application Security and Privacy10.1145/3626232.3653271(91-102)Online publication date: 19-Jun-2024
  • (2024)APP-Miner: Detecting API Misuses via Automatically Mining API Path Patterns2024 IEEE Symposium on Security and Privacy (SP)10.1109/SP54263.2024.00043(4034-4052)Online publication date: 19-May-2024
  • Show More Cited By

Index Terms

  1. Exaggerated Error Handling Hurts! An In-Depth Study and Context-Aware Detection

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    CCS '20: Proceedings of the 2020 ACM SIGSAC Conference on Computer and Communications Security
    October 2020
    2180 pages
    ISBN:9781450370899
    DOI:10.1145/3372297
    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

    Sponsors

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 02 November 2020

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. bug detection
    2. exaggerated error handling
    3. os kernel bug
    4. static analysis

    Qualifiers

    • Research-article

    Funding Sources

    • NSF

    Conference

    CCS '20
    Sponsor:

    Acceptance Rates

    Overall Acceptance Rate 1,261 of 6,999 submissions, 18%

    Upcoming Conference

    CCS '24
    ACM SIGSAC Conference on Computer and Communications Security
    October 14 - 18, 2024
    Salt Lake City , UT , USA

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)105
    • Downloads (Last 6 weeks)4
    Reflects downloads up to 04 Oct 2024

    Other Metrics

    Citations

    Cited By

    View all
    • (2024)Cut to the Chase: An Error-Oriented Approach to Detect Error-Handling BugsProceedings of the ACM on Software Engineering10.1145/36607871:FSE(1796-1818)Online publication date: 12-Jul-2024
    • (2024)Process-Aware Intrusion Detection in MQTT NetworksProceedings of the Fourteenth ACM Conference on Data and Application Security and Privacy10.1145/3626232.3653271(91-102)Online publication date: 19-Jun-2024
    • (2024)APP-Miner: Detecting API Misuses via Automatically Mining API Path Patterns2024 IEEE Symposium on Security and Privacy (SP)10.1109/SP54263.2024.00043(4034-4052)Online publication date: 19-May-2024
    • (2024)Towards Effective and Efficient Error Handling Code Fuzzing Based on Software Fault Injection2024 IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER)10.1109/SANER60148.2024.00039(320-331)Online publication date: 12-Mar-2024
    • (2023)QueryX: Symbolic Query on Decompiled Code for Finding Bugs in COTS Binaries2023 IEEE Symposium on Security and Privacy (SP)10.1109/SP46215.2023.10179314(3279-3295)Online publication date: May-2023
    • (2023)Finding Missing Security Operation Bugs via Program Slicing and Differential CheckInformation and Communications Security10.1007/978-981-99-7356-9_41(702-718)Online publication date: 20-Oct-2023
    • (2023)Detecting API Missing-Check Bugs Through Complete Cross Checking of Erroneous ReturnsInformation Security and Cryptology10.1007/978-3-031-26553-2_21(391-407)Online publication date: 19-Feb-2023
    • (2022)Non-Distinguishable Inconsistencies as a Deterministic Oracle for Detecting Security BugsProceedings of the 2022 ACM SIGSAC Conference on Computer and Communications Security10.1145/3548606.3560661(3253-3267)Online publication date: 7-Nov-2022
    • (2021)ACHyb: a hybrid analysis approach to detect kernel access control vulnerabilitiesProceedings of the 29th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering10.1145/3468264.3468627(316-327)Online publication date: 20-Aug-2021
    • (2021)Detecting Missed Security Operations Through Differential Checking of Object-based Similar PathsProceedings of the 2021 ACM SIGSAC Conference on Computer and Communications Security10.1145/3460120.3485373(1627-1644)Online publication date: 12-Nov-2021

    View Options

    Get Access

    Login options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media