Coccinelle: Bug Finding for the Linux Community

Size: px
Start display at page:

Download "Coccinelle: Bug Finding for the Linux Community"

Transcription

1 Coccinelle: Bug Finding for the Linux Community Julia Lawall (INRIA) Gilles Muller (INRIA), René Rydhof Hansen (Aalborg), Nicolas Palix (Grenoble) January 6, 2012

2 Overview Goal: Improving the robustness of systems code, eg Linux. Approach: Static analysis to find bugs. Automatic program transformation to fix them. Our contribution: A domain-specific language for specifying matching and transformation rules. An engine for applying these specifications. Lots of Linux patches.

3 What is the problem with this code? drivers/staging/et131x/et131x netdev.c void et131x_tx_timeout(struct net_device *netdev) { struct et131x_adapter *adapter = netdev_priv(netdev); struct tcb *tcb; unsigned long flags; /* Any nonrecoverable hardware error? * Checks adapter->flags for any failure in phy reading */ if (adapter->flags & MP_ADAPTER_NON_RECOVER_ERROR); return;

4 What is the problem with this code? drivers/staging/et131x/et131x netdev.c void et131x_tx_timeout(struct net_device *netdev) { struct et131x_adapter *adapter = netdev_priv(netdev); struct tcb *tcb; unsigned long flags; /* Any nonrecoverable hardware error? * Checks adapter->flags for any failure in phy reading */ if (adapter->flags & MP_ADAPTER_NON_RECOVER_ERROR); return;

5 What is the problem with this code? drivers/media/video/pwc/pwc-v4l.c int pwc_init_controls(struct pwc_device *pdev) { if (!pdev->features & FEATURE_MOTOR_PANTILT) return hdl->error;

6 What is the problem with this code? drivers/media/video/pwc/pwc-v4l.c int pwc_init_controls(struct pwc_device *pdev) { if (!pdev->features & FEATURE_MOTOR_PANTILT) return hdl->error;

7 What is the problem with this code? drivers/staging/brcm80211/brcmsmac/mac80211 if.c static int brcms_suspend(struct pci_dev *pdev, pm_message_t state) { hw = pci_get_drvdata(pdev); wl = hw->priv; if (!wl) { wiphy_err(wl->wiphy, "brcms_suspend: pci_get_drvdata failed"); return -ENODEV;

8 What is the problem with this code? drivers/staging/brcm80211/brcmsmac/mac80211 if.c static int brcms_suspend(struct pci_dev *pdev, pm_message_t state) { hw = pci_get_drvdata(pdev); wl = hw->priv; if (!wl) { wiphy_err(wl->wiphy, "brcms_suspend: pci_get_drvdata failed"); return -ENODEV;

9 Impact Faults may occur in corner cases. Corrupted error logs. Corrupted device state. Deadlocks, memory leaks. Finding faults by testing is difficult. Many different possible interactions. Many different possible compile-time configurations.

10 Issues How can we find these problems in large software? Linux: files, over 8 million lines of code. Debian: Over projects. How can we fix these problems reliably? Manual changes can introduce more faults. There is a need for automated tools.

11 Our goals Automatically find code containing bugs or defects. Automatically fix bugs or defects. Provide a system that is accessible to software developers.

12 Requirements for automation The ability to abstract over irrelevant information: Example: if (adapter->flags & MP ADAPTER NON RECOVER ERROR); The ability to match scattered code fragments: Example: wl->wiphy may occur anywhere within if (!wl) {. The ability to transform code fragments: Example: Replace!pdev->features & FEATURE MOTOR PANTILT by!(pdev->features & FEATURE MOTOR PANTILT).

13 Coccinelle Program matching and transformation for unpreprocessed C code. Fits with the existing habits of C programmers. C-like, patch-like notation Semantic patch language (SmPL): Metavariables for abstracting over subterms.... for abstracting over code sequences. Patch-like notation ( /+) for expressing transformations.

14 An example patch commit 4264a8b6388f5ba16a5c362857cb8bda0b14167f Author: Dan Carpenter Date: Sat Jul 23 15:53: [media] pwc: precedence bug in pwc_init_controls()! has higher precedence than & so we need parenthesis here. Signed-off-by: Dan Carpenter diff --git a/drivers/media/video/pwc/pwc-v4l.c b/drivers/media/video/pwc/pwc-v4l --- a/drivers/media/video/pwc/pwc-v4l.c +++ b/drivers/media/video/pwc/pwc-v4l.c -338,7 +338,7 int pwc_init_controls(struct pwc_device *pdev) if (pdev->restore_factory) pdev->restore_factory->flags = V4L2_CTRL_FLAG_UPDATE; - if (!pdev->features & FEATURE_MOTOR_PANTILT) + if (!(pdev->features & FEATURE_MOTOR_PANTILT)) return hdl->error; /* Motor pan / tilt / reset */

15 Semantic patches: Bug finding (and fixing) expression E; constant C; -!E & C +!(E & C)

16 Semantic patches: Bug finding (and fixing) expression E; constant C; -!E & C +!(E & C)

17 Potential impact of the semantic patch Defects next linux linux linux linux linux linux linux linux linux linux linux linux linux linux linux linux linux linux

18 A more complex example static int brcms_suspend(struct pci_dev *pdev, pm_message_t state) { if (!wl) { wiphy_err(wl->wiphy, "brcms_suspend: pci_get_drvdata failed"); return -ENODEV; Issues: wl can be any expression. wiphy can be any field name (identifier). wl->wiphy can appear anywhere after the test, within the if braces.

19 Semantic patch expression wl; identifier wiphy; if (!wl) { wiphy_err(wl->wiphy, "brcms_suspend: pci_get_drvdata failed"); return -ENODEV;

20 Semantic patch expression wl; identifier wiphy; if (!wl) { wiphy_err(wl->wiphy, "brcms_suspend: pci_get_drvdata failed"); return -ENODEV;

21 Semantic patch expression wl; identifier wiphy; if (!wl) { * wl->wiphy

22 A false positive diff -u -p a/crypto/api.c b/crypto/api.c --- a/crypto/api.c +++ b/crypto/api.c -146,7 +146,6 static struct crypto_alg *crypto_larval_ alg = crypto_alg_lookup(name, type, mask); if (!alg) { alg = &larval->alg; - list_add(&alg->cra_list, &crypto_alg_list); up_write(&crypto_alg_sem);

23 Eliminating the false positive expression wl,e; identifier wiphy; if (!wl) { when!= wl = E * wl->wiphy

24 A further refinement expression wl,e; identifier wiphy; if (!wl) { when!= wl = E * wl->wiphy when any

25 Faults in Linux: Fault rate % of faulty notes Average Staging Drivers Sound Arch FS Net Other

26 Faults in Linux: Fault kinds % of faulty notes Average BlockLock Null Var IsNull NullRef Range Lock Intr LockIntr Free Size hello

27 How does it work? Semantic patch C code AX(A[(ϕ 1 ϕ 2 )Uϕ 3 ]...) CTL formula Control Flow Graph Model checking algorithm Identification of the nodes to be modified Modification of the identified code

28 Current status Over 800 patches based on Coccinelle accepted into the Linux kernel. A collection of semantic patches integrated into the Linux kernel source tree. Several LWN articles by Linux developers. Seems to be easy to learn. Used by developers of Linux and other software. Articles in EuroSys, DSN, POPL, ASE, AOSD, etc. on the language and methodology.

29 Conclusion Coccinelle provides a declarative language for program matching and transformation. Coccinelle semantic patches look like patches; fit with Linux programmers habits. Quite easy to learn; already accepted by the Linux community. Future work will build on Coccinelle to develop tools motivated by problems observed in Linux development.

30

Inside the Mind of a Coccinelle Programmer

Inside the Mind of a Coccinelle Programmer Inside the Mind of a Coccinelle Programmer Julia Lawall (Inria/LIP6) Linux Security Summit August 25, 2016 2 What is Coccinelle? Find once, fix everywhere. Approach: Coccinelle: http://coccinelle.lip6.fr/

More information

Finding Error Handling Bugs in OpenSSL using Coccinelle

Finding Error Handling Bugs in OpenSSL using Coccinelle 1 Finding Error Handling Bugs in OpenSSL using Coccinelle (Practical Experience Report) Julia Lawall (University of Copenhagen/INRIA-Regal) Ben Laurie (Google), René Rydhof Hansen (Aalborg University),

More information

Coccinelle: A Program Matching and Transformation Tool for Linux

Coccinelle: A Program Matching and Transformation Tool for Linux Coccinelle: A Program Matching and Transformation Tool for Linux Nicolas Palix (DIKU) joint work with Julia Lawall (DIKU), Gilles Muller (INRIA) Jesper Andersen, Julien Brunel, René Rydhof Hansen, and

More information

Coccinelle: A Program Matching and Transformation Tool for Systems Code

Coccinelle: A Program Matching and Transformation Tool for Systems Code Coccinelle: A Program Matching and Transformation Tool for Systems Code Gilles Muller Julia Lawall (INRIA/LIP6/IRILL) http://coccinelle.lip6.fr The problem: Dealing with Legacy Systems Code (Linux) It

More information

Coccinelle: Practical Program Transformation for the Linux Kernel. Julia Lawall (Inria/LIP6) June 25, 2018

Coccinelle: Practical Program Transformation for the Linux Kernel. Julia Lawall (Inria/LIP6) June 25, 2018 Coccinelle: Practical Program Transformation for the Linux Kernel Julia Lawall (Inria/LIP6) June 25, 2018 1 Motivation Large, critical infrastructure-software code bases Linux kernel, OpenSSL, Qemu, Firefox,

More information

Introduction to Coccinelle

Introduction to Coccinelle Introduction to Coccinelle Julia Lawall (Inria/LIP6) http://coccinelle.lip6.fr September 17, 2014 Common programming problems Programmers don t really understand how C works.!e1 & e2 does a bit-and with

More information

Coccinelle. Julia Lawall (Inria/Irill/LIP6) August 19, 2015

Coccinelle. Julia Lawall (Inria/Irill/LIP6)     August 19, 2015 1 Coccinelle Julia Lawall (Inria/Irill/LIP6) http://coccinelle.lip6.fr http://btrlinux.inria.fr August 19, 2015 Goal Help developers scan and transform a large legacy C code base. Applications: Bug finding

More information

Faults in Linux 2.6. Nicolas Palix, Gaël Thomas, Suman Saha, Christophe Calvès, Gilles Muller, Julia L. Lawall. To cite this version:

Faults in Linux 2.6. Nicolas Palix, Gaël Thomas, Suman Saha, Christophe Calvès, Gilles Muller, Julia L. Lawall. To cite this version: Faults in Linux 2.6 Nicolas Palix, Gaël Thomas, Suman Saha, Christophe Calvès, Gilles Muller, Julia L. Lawall To cite this version: Nicolas Palix, Gaël Thomas, Suman Saha, Christophe Calvès, Gilles Muller,

More information

Understanding the Genetic Makeup of Linux Device Drivers

Understanding the Genetic Makeup of Linux Device Drivers Understanding the Genetic Makeup of Linux Device Drivers (Work in Progress) Peter Senna Tschudin, Laurent Réveillère, Lingxiao Jiang, David Lo, Julia Lawall, Gilles Muller LIP6 Inria & UPMC, LaBRI, Singapore

More information

Linux for Safety Critical Applications: Hunting down bug patterns

Linux for Safety Critical Applications: Hunting down bug patterns Linux for Safety Critical Applications: Hunting down bug patterns GNU/Linux for Safety Open-Source procedures and decisions Availability of technology and know-how Built on

More information

Increasing Automation in the Backporting of Linux Drivers Using Coccinelle

Increasing Automation in the Backporting of Linux Drivers Using Coccinelle Increasing Automation in the Backporting of Linux Drivers Using Coccinelle Luis R. Rodriguez, (SUSE Labs) Julia Lawall (Inria/LIP6/UPMC/Sorbonne University-Whisper) January, 2015 (Unpublished work) What

More information

Increasing Automation in the Backporting of Linux Drivers Using Coccinelle

Increasing Automation in the Backporting of Linux Drivers Using Coccinelle 1 Increasing Automation in the Backporting of Linux Drivers Using Coccinelle Luis R. Rodriguez, (SUSE Labs) Julia Lawall (Inria/LIP6/UPMC/Sorbonne Universités) September 10, 2015 What is backporting? Linux

More information

Coccinelle: Killing Driver Bugs Before They Hatch

Coccinelle: Killing Driver Bugs Before They Hatch Coccinelle: Killing Driver Bugs Before They Hatch Julia Lawall DIKU, University of Copenhagen Gilles Muller, Richard Urunuela École des Mines de Nantes-INRIA, LINA OS evolution Motivations: Improve performance.

More information

Important From Last Time

Important From Last Time Important From Last Time Embedded C Pros and cons Macros and how to avoid them Intrinsics Interrupt syntax Inline assembly Today Advanced C What C programs mean How to create C programs that mean nothing

More information

Page 1. Today. Important From Last Time. Is the assembly code right? Is the assembly code right? Which compiler is right?

Page 1. Today. Important From Last Time. Is the assembly code right? Is the assembly code right? Which compiler is right? Important From Last Time Today Embedded C Pros and cons Macros and how to avoid them Intrinsics Interrupt syntax Inline assembly Advanced C What C programs mean How to create C programs that mean nothing

More information

Faults in Linux: Ten Years Later

Faults in Linux: Ten Years Later INSTITUT NATIONAL DE RECHERCHE EN INFORMATIQUE ET EN AUTOMATIQUE Faults in Linux: Ten Years Later Nicolas Palix Suman Saha Gaël Thomas Christophe Calvès Julia Lawall Gilles Muller N 7357 Juillet 21 Domaine

More information

SmPL: A Domain-Specic Language for Specifying Collateral Evolutions in Linux Device Drivers

SmPL: A Domain-Specic Language for Specifying Collateral Evolutions in Linux Device Drivers SmPL: A Domain-Specic Language for Specifying Collateral Evolutions in Linux Device Drivers Yoann Padioleau Ecole des Mines de Nantes Julia Lawall, DIKU, University of Copenhagen Gilles Muller, Ecole des

More information

Important From Last Time

Important From Last Time Important From Last Time Embedded C Ø Pros and cons Macros and how to avoid them Intrinsics Interrupt syntax Inline assembly Today Advanced C What C programs mean How to create C programs that mean nothing

More information

Fast and Precise Retrieval of Forward and Back Porting Information for Linux Device Drivers

Fast and Precise Retrieval of Forward and Back Porting Information for Linux Device Drivers Fast and Precise Retrieval of Forward and Back Porting Information for Linux Device Drivers Julia Lawall, Derek Palinski, Lukas Gnirke, and Gilles Muller, Sorbonne Universités/UPMC/Inria/LIP6 https://www.usenix.org/conference/atc17/technical-sessions/presentation/lawall

More information

Documenting and Automating Collateral Evolutions in Linux Device Drivers

Documenting and Automating Collateral Evolutions in Linux Device Drivers Documenting and Automating Collateral Evolutions in Linux Device Drivers Yoann Padioleau Julia Lawall Ecole des Mines DIKU, University of de Nantes Copenhagen yoann.padioleau@acm.org julia@diku.dk René

More information

Prequel: A Patch-Like Query Language for Commit History Search

Prequel: A Patch-Like Query Language for Commit History Search Prequel: A Patch-Like Query Language for Commit History Search Julia Lawall, Quentin Lambert, Gilles Muller To cite this version: Julia Lawall, Quentin Lambert, Gilles Muller. Prequel: A Patch-Like Query

More information

Coccinelle Usage (version 0.1.7)

Coccinelle Usage (version 0.1.7) Coccinelle Usage (version 0.1.7) June 5, 2009 1 Introduction This document describes the options provided by Coccinelle. The options have an impact on various phases of the semantic patch application process.

More information

Towards Easing the Diagnosis of Bugs in OS Code

Towards Easing the Diagnosis of Bugs in OS Code Towards Easing the Diagnosis of Bugs in OS Code Henrik Stuart René Rydhof Hansen Julia L. Lawall Jesper Andersen DIKU, University of Copenhagen, Copenhagen, Denmark {hstuart,rrhansen,julia,jespera}@diku.dk

More information

3L: Learning Linux Logging (Extended Abstract for BENEVOL 15)

3L: Learning Linux Logging (Extended Abstract for BENEVOL 15) 3L: Learning Linux Logging (Extended Abstract for BENEVOL 15) Peter Senna Tschudin Peter.Senna@lip6.fr Julia Lawall Julia.Lawall@lip6.fr Gilles Muller Gilles.Muller@lip6.fr Abstract Logging is a common

More information

Accelerating Storage with NVM Express SSDs and P2PDMA Stephen Bates, PhD Chief Technology Officer

Accelerating Storage with NVM Express SSDs and P2PDMA Stephen Bates, PhD Chief Technology Officer Accelerating Storage with NVM Express SSDs and P2PDMA Stephen Bates, PhD Chief Technology Officer 2018 Storage Developer Conference. Eidetic Communications Inc. All Rights Reserved. 1 Outline Motivation

More information

Ahead of Time Static Analysis for Automatic Generation of Debugging Interfaces to the Linux Kernel

Ahead of Time Static Analysis for Automatic Generation of Debugging Interfaces to the Linux Kernel Ahead of Time Static Analysis for Automatic Generation of Debugging Interfaces to the Linux Kernel Tegawendé F. Bissyandé, Laurent Réveillère, Julia Lawall, Gilles Muller To cite this version: Tegawendé

More information

Improving Linux development with better tools

Improving Linux development with better tools Improving Linux development with better tools Andi Kleen Oct 2013 Intel Corporation ak@linux.intel.com Linux complexity growing Source lines in Linux kernel All source code 16.5 16 15.5 M-LOC 15 14.5 14

More information

Coccinelle: Tool support for automated CERT C Secure Coding Standard certification

Coccinelle: Tool support for automated CERT C Secure Coding Standard certification Coccinelle: Tool support for automated CERT C Secure Coding Standard certification Mads Chr. Olesen a, René Rydhof Hansen a,, Julia L. Lawall b, Nicolas Palix b a Department of Computer Science, Aalborg

More information

Advanced SmPL: Finding Missing IS ERR tests

Advanced SmPL: Finding Missing IS ERR tests 1 Advanced SmPL: Finding Missing IS ERR tests Julia Lawall January 26, 2011 The error handling problem The C language does not provide any error handling abstractions. For pointer-typed functions, Linux

More information

Faults in Linux: Ten years later

Faults in Linux: Ten years later Faults in Linux: Ten years later A case for reproducible scientific results Nicolas Palix et. al ASPLOS 2011 The story begins in 2001... Chou et al.: An empirical study of operating system bugs [CYC +

More information

Improving Linux Development with better tools. Andi Kleen. Oct 2013 Intel Corporation

Improving Linux Development with better tools. Andi Kleen. Oct 2013 Intel Corporation Improving Linux Development with better tools Andi Kleen Oct 2013 Intel Corporation ak@linux.intel.com Linux complexity growing Source lines in Linux kernel All source code 16.5 16 15.5 M-LOC 15 14.5 14

More information

Bachelor s Thesis : Finding Bugs in Open Source Software using Coccinelle

Bachelor s Thesis : Finding Bugs in Open Source Software using Coccinelle Bachelor s Thesis : Finding Bugs in Open Source Software using Coccinelle Sune Rievers - sunerievers@stud.ku.dk Supervisor: Julia Lawall January 13, 2010 1 Contents 1 Abstract 4 2 Preface 5 3 Acknowledgments

More information

Aalborg Universitet. Published in: Science of Computer Programming. DOI (link to publication from Publisher): /j.scico

Aalborg Universitet. Published in: Science of Computer Programming. DOI (link to publication from Publisher): /j.scico Downloaded from vbn.aau.dk on: marts 27, 2019 Aalborg Universitet Coccinelle Tool support for automated CERT C Secure Coding Standard certification Olesen, Mads Chr.; Hansen, Rene Rydhof; Lawall, Julia

More information

On Reconciling Patches and Aspects Laurent Burgy Marc Fiuczynski Marco Yuen Robert Grimm Department of Computer Science Princeton University

On Reconciling Patches and Aspects Laurent Burgy Marc Fiuczynski Marco Yuen Robert Grimm Department of Computer Science Princeton University On Reconciling Patches and Aspects Laurent Burgy Marc Fiuczynski Marco Yuen Robert Grimm Princeton University University of Victoria New York University ABSTRACT In previous work, we presented a domain-specific

More information

CSC C69: OPERATING SYSTEMS

CSC C69: OPERATING SYSTEMS CSC C69: OPERATING SYSTEMS Tutorial 1 Thursday, Jan 17, 2013 TA: Ioan Stefanovici (ioan@cs.toronto.edu) HOW DO YOU SUCCEED IN THIS COURSE? Show up to lectures & tutorials (way too much material) Work on

More information

Today's Topics. CISC 458 Winter J.R. Cordy

Today's Topics. CISC 458 Winter J.R. Cordy Today's Topics Last Time Semantics - the meaning of program structures Stack model of expression evaluation, the Expression Stack (ES) Stack model of automatic storage, the Run Stack (RS) Today Managing

More information

A Foundation for Flow-Based Program Matching

A Foundation for Flow-Based Program Matching A Foundation for Flow-Based Program Matching Using Temporal Logic and Model Checking Julien Brunel DIKU, University of Copenhagen, Denmark brunel@diku.dk Damien Doligez INRIA, Gallium Project, France damien.doligez@inria.fr

More information

ClabureDB: Classified Bug-Reports Database

ClabureDB: Classified Bug-Reports Database ClabureDB: Classified Bug-Reports Database Tool for developers of program analysis tools Jiri Slaby, Jan Strejček, and Marek Trtík Faculty of Informatics, Masaryk University Botanická 68a, 60200 Brno,

More information

Static program checking and verification

Static program checking and verification Chair of Software Engineering Software Engineering Prof. Dr. Bertrand Meyer March 2007 June 2007 Slides: Based on KSE06 With kind permission of Peter Müller Static program checking and verification Correctness

More information

Comprehensive Kernel Instrumentation via Dynamic Binary Translation

Comprehensive Kernel Instrumentation via Dynamic Binary Translation Comprehensive Kernel Instrumentation via Dynamic Binary Translation Peter Feiner Angela Demke Brown Ashvin Goel University of Toronto 011 Complexity of Operating Systems 012 Complexity of Operating Systems

More information

TypeChef: Towards Correct Variability Analysis of Unpreprocessed C Code for Software Product Lines

TypeChef: Towards Correct Variability Analysis of Unpreprocessed C Code for Software Product Lines TypeChef: Towards Correct Variability Analysis of Unpreprocessed C Code for Software Product Lines Paolo G. Giarrusso 04 March 2011 Software product lines (SPLs) Feature selection SPL = 1 software project

More information

Regression testing. Whenever you find a bug. Why is this a good idea?

Regression testing. Whenever you find a bug. Why is this a good idea? Regression testing Whenever you find a bug Reproduce it (before you fix it!) Store input that elicited that bug Store correct output Put into test suite Then, fix it and verify the fix Why is this a good

More information

The Semantics of Semantic Patches in Coccinelle: Program Transformation for the Working Programmer

The Semantics of Semantic Patches in Coccinelle: Program Transformation for the Working Programmer The Semantics of Semantic Patches in Coccinelle: Program Transformation for the Working Programmer Neil D. Jones 1 and René Rydhof Hansen 2 1 DIKU (Computer Science Dept., University of Copenhagen, Denmark)

More information

How Double-Fetch Situations turn into Double-Fetch Vulnerabilities:

How Double-Fetch Situations turn into Double-Fetch Vulnerabilities: How Double-Fetch Situations turn into Double-Fetch Vulnerabilities: A Study of Double Fetches in the Linux Kernel Pengfei Wang, Jens Krinke, Kai Lu, Gen Li, Steve Dodier-Lazaro College of Computer National

More information

Steps for project success. git status. Milestones. Deliverables. Homework 1 submitted Homework 2 will be posted October 26.

Steps for project success. git status. Milestones. Deliverables. Homework 1 submitted Homework 2 will be posted October 26. git status Steps for project success Homework 1 submitted Homework 2 will be posted October 26 due November 16, 9AM Projects underway project status check-in meetings November 9 System-building project

More information

Automatic Source Audit with GCC. CoolQ Redpig Fedora

Automatic Source Audit with GCC. CoolQ Redpig Fedora Automatic Source Audit with GCC CoolQ Redpig Fedora Contents Problems with software evolution Framework for automatic/static analysis An attempt BDL Bug Description Language Architecture overview Module

More information

Coccigrep: a semantic grep for C language

Coccigrep: a semantic grep for C language Coccigrep: a semantic grep for C language Éric Leblond Stamus Networks April 27, 2014 Éric Leblond (Stamus Networks) Coccigrep: a semantic grep for C language April 27, 2014 1 / 14 Eric Leblond a.k.a Regit

More information

High Performance Computing

High Performance Computing High Performance Computing MPI and C-Language Seminars 2009 Photo Credit: NOAA (IBM Hardware) High Performance Computing - Seminar Plan Seminar Plan for Weeks 1-5 Week 1 - Introduction, Data Types, Control

More information

5) Attacker causes damage Different to gaining control. For example, the attacker might quit after gaining control.

5) Attacker causes damage Different to gaining control. For example, the attacker might quit after gaining control. Feb 23, 2009 CSE, 409/509 Mitigation of Bugs, Life of an exploit 1) Bug inserted into code 2) Bug passes testing 3) Attacker triggers bug 4) The Attacker gains control of the program 5) Attacker causes

More information

PFStat. Global notes

PFStat. Global notes PFStat Global notes Counts expand_stack returns in case of error, so the stack_low count needed to be inside transparent huge page, 2 cases : There is no PMD, we should create a transparent one (There

More information

Automatic Mining of Functionally Equivalent Code Fragments via Random Testing. Lingxiao Jiang and Zhendong Su

Automatic Mining of Functionally Equivalent Code Fragments via Random Testing. Lingxiao Jiang and Zhendong Su Automatic Mining of Functionally Equivalent Code Fragments via Random Testing Lingxiao Jiang and Zhendong Su Cloning in Software Development How New Software Product Cloning in Software Development Search

More information

Fault Isolation for Device Drivers

Fault Isolation for Device Drivers Fault Isolation for Device Drivers 39 th International Conference on Dependable Systems and Networks, 30 June 2009, Estoril Lisbon, Portugal Jorrit N. Herder Vrije Universiteit Amsterdam ~26% of Windows

More information

Remote Core Locking. Migrating Critical-Section Execution to Improve the Performance of Multithreaded Applications. to appear at USENIX ATC 12

Remote Core Locking. Migrating Critical-Section Execution to Improve the Performance of Multithreaded Applications. to appear at USENIX ATC 12 Remote Core Locking Migrating Critical-Section Execution to Improve the Performance of Multithreaded Applications to appear at USENIX ATC 12 Jean-Pierre Lozi LIP6/INRIA Florian David LIP6/INRIA Gaël Thomas

More information

Semantic Patches. Yoann Padioleau EMN Julia L. Lawall DIKU Gilles Muller EMN

Semantic Patches. Yoann Padioleau EMN Julia L. Lawall DIKU Gilles Muller EMN Semantic Patches Documenting and Automating Collateral Evolutions in Linux Device Drivers Yoann Padioleau EMN padator@wanadoo.fr Julia L. Lawall DIKU julia@diku.dk Gilles Muller EMN Gilles.Muller@emn.fr

More information

CS 520 Theory and Practice of Software Engineering Fall 2018

CS 520 Theory and Practice of Software Engineering Fall 2018 CS 520 Theory and Practice of Software Engineering Fall 2018 Nediyana Daskalova Monday, 4PM CS 151 Debugging October 30, 2018 Personalized Behavior-Powered Systems for Guiding Self-Experiments Help me

More information

Clustering the Kernel

Clustering the Kernel Alexandre Lissy Mandriva S.A. alissy@mandriva.com Clustering the Kernel Patrick Martineau Jean Parpaillon Mandriva S.A. jparpaillon@mandriva.com University François Rabelais Tours, Laboratory of Computer

More information

Kernel Internship Report (Outreachy)

Kernel Internship Report (Outreachy) Kernel Internship Report (Outreachy) Successor of the Outreach Program for Women (OPW) Julia Lawall (Inria/Irill/LIP6) Ebru Akagündüz, Roberta Dobrescu, Aya Mahfouz, Iulia Manda, Cristina Georgiana Opriceana,

More information

Xen/paravirt_ops upstreaming Jeremy Fitzhardinge XenSource 04/18/07

Xen/paravirt_ops upstreaming Jeremy Fitzhardinge XenSource 04/18/07 Xen/paravirt_ops upstreaming Jeremy Fitzhardinge XenSource jeremy@xensource.com Where Did We Come From? Initially arch/xen Moved to a i386 subarch Upstreaming stalled VMI posted Deadlock paravirt_ops KS

More information

Programming in C and C++

Programming in C and C++ Programming in C and C++ 10. C Semantics: Undefined Behaviour & Optimization Issues Dr. Anil Madhavapeddy University of Cambridge (based on previous years thanks to Alan Mycroft, Alastair Beresford and

More information

CS 220: Introduction to Parallel Computing. Beginning C. Lecture 2

CS 220: Introduction to Parallel Computing. Beginning C. Lecture 2 CS 220: Introduction to Parallel Computing Beginning C Lecture 2 Today s Schedule More C Background Differences: C vs Java/Python The C Compiler HW0 8/25/17 CS 220: Parallel Computing 2 Today s Schedule

More information

Maintaining an Out-of-Tree Driver and an Upstream Driver Simultaneously (with minimal pain)

Maintaining an Out-of-Tree Driver and an Upstream Driver Simultaneously (with minimal pain) Maintaining an Out-of-Tree Driver and an Upstream Driver Simultaneously (with minimal pain) Catherine Sullivan Intel LinuxCon 2015 Me Intel ND Linux Ethernet drivers 40G product line A little 10G Network

More information

An Operational and Axiomatic Semantics for Non-determinism and Sequence Points in C

An Operational and Axiomatic Semantics for Non-determinism and Sequence Points in C An Operational and Axiomatic Semantics for Non-determinism and Sequence Points in C Robbert Krebbers Radboud University Nijmegen January 22, 2014 @ POPL, San Diego, USA 1 / 16 What is this program supposed

More information

Runtime Power Management Framework

Runtime Power Management Framework Runtime Power Management Framework for I/O Devices in the Linux Kernel Rafael J. Wysocki Faculty of Physics UW / SUSE Labs, Novell Inc. July 31, 2010 Rafael J. Wysocki (rjw@sisk.pl) Runtime Power Management

More information

Designing Responsive and Real-Time Systems

Designing Responsive and Real-Time Systems Designing Responsive and Real-Time Systems Chapter 10 Renesas Electronics America Inc. Embedded Systems using the RX63N Rev. 1.0 00000-A Learning Objectives Most Embedded Systems have multiple real time

More information

Lecture Outline. COOL operational semantics. Operational Semantics of Cool. Motivation. Notation. The rules. Evaluation Rules So Far.

Lecture Outline. COOL operational semantics. Operational Semantics of Cool. Motivation. Notation. The rules. Evaluation Rules So Far. Lecture Outline Operational Semantics of Cool COOL operational semantics Motivation Adapted from Lectures by Profs. Alex Aiken and George Necula (UCB) Notation The rules CS781(Prasad) L24CG 1 CS781(Prasad)

More information

Operational Semantics. One-Slide Summary. Lecture Outline

Operational Semantics. One-Slide Summary. Lecture Outline Operational Semantics #1 One-Slide Summary Operational semantics are a precise way of specifying how to evaluate a program. A formal semantics tells you what each expression means. Meaning depends on context:

More information

LCA14-107: ACPI upstreaming. Wed-5-Mar, 11:15am, Al Stone, G Gregory, Hanjun Guo

LCA14-107: ACPI upstreaming. Wed-5-Mar, 11:15am, Al Stone, G Gregory, Hanjun Guo LCA14-107: ACPI upstreaming Wed-5-Mar, 11:15am, Al Stone, G Gregory, Hanjun Guo ACPI Upstreaming Staged for 3.15 (in linux-next): Odds and ends: APEI cleanups, white space, minor bugs in ACPI driver Reduced

More information

(Not Quite) Minijava

(Not Quite) Minijava (Not Quite) Minijava CMCS22620, Spring 2004 April 5, 2004 1 Syntax program mainclass classdecl mainclass class identifier { public static void main ( String [] identifier ) block } classdecl class identifier

More information

Tolerating Malicious Drivers in Linux. Silas Boyd-Wickizer and Nickolai Zeldovich

Tolerating Malicious Drivers in Linux. Silas Boyd-Wickizer and Nickolai Zeldovich XXX Tolerating Malicious Drivers in Linux Silas Boyd-Wickizer and Nickolai Zeldovich How could a device driver be malicious? Today's device drivers are highly privileged Write kernel memory, allocate memory,...

More information

C Program Development and Debugging under Unix SEEM 3460

C Program Development and Debugging under Unix SEEM 3460 C Program Development and Debugging under Unix SEEM 3460 1 C Basic Elements SEEM 3460 2 C - Basic Types Type (32 bit) Smallest Value Largest Value short int -32,768(-2 15 ) 32,767(2 15-1) unsigned short

More information

#include <stdio.h> int main() { char s[] = Hsjodi, *p; for (p = s + 5; p >= s; p--) --*p; puts(s); return 0;

#include <stdio.h> int main() { char s[] = Hsjodi, *p; for (p = s + 5; p >= s; p--) --*p; puts(s); return 0; 1. Short answer questions: (a) Compare the typical contents of a module s header file to the contents of a module s implementation file. Which of these files defines the interface between a module and

More information

ACT-R WS JSON Network Interface (JNI) to ACT-R Interfacing ACT-R with External Environments. Rensselaer Cognitive. Mike Schoelles and Ryan Hope

ACT-R WS JSON Network Interface (JNI) to ACT-R Interfacing ACT-R with External Environments. Rensselaer Cognitive. Mike Schoelles and Ryan Hope JSON Network Interface (JNI) to ACT-R Interfacing ACT-R with External Environments Mike Schoelles and Ryan Hope ACT-R WS 2013 Motivation ACT-R should be able to interface with complex, dynamic task environments/simulations

More information

K-Miner Uncovering Memory Corruption in Linux

K-Miner Uncovering Memory Corruption in Linux K-Miner Uncovering Memory Corruption in Linux David Gens Simon Schmitt Ahmad-Reza Sadeghi Cyber Security Center (CYSEC) Technische Universität Darmstadt Lucas Davi Universität of Duisburg-Essen Why Static

More information

Writing drivers for the Linux Crypto subsystem

Writing drivers for the Linux Crypto subsystem May 18, 2014 Marek Vasut Software engineer at DENX S.E. since 2011 Embedded and Real-Time Systems Services, Linux kernel and driver development, U-Boot development, consulting, training. Versatile Linux

More information

Diagnosys: Automatic Generation of a Debugging Interface to the Linux Kernel

Diagnosys: Automatic Generation of a Debugging Interface to the Linux Kernel Diagnosys: Automatic Generation of a Debugging Interface to the Linux Kernel Tegawendé F. Bissyandé, Laurent Réveillère University of Bordeaux, France {bissyande,reveillere}@labri.fr Julia L. Lawall, Gilles

More information

CS 61c: Great Ideas in Computer Architecture

CS 61c: Great Ideas in Computer Architecture Arrays, Strings, and Some More Pointers June 24, 2014 Review of Last Lecture C Basics Variables, functioss, control flow, types, structs Only 0 and NULL evaluate to false Pointers hold addresses Address

More information

Hint #1. Define a syscall

Hint #1. Define a syscall PC 5 System call Exercice Clone the git repository git clone http://gitlab.montefiore.ulg.ac.be/info0940/kernel-4.4.50.git Make a "PC4" branch Add a sys_forkexec system call It is the equivalent of calling

More information

Ethernet switch support in the Linux kernel

Ethernet switch support in the Linux kernel ELC 2018 Ethernet switch support in the Linux kernel Alexandre Belloni alexandre.belloni@bootlin.com Copyright 2004-2018, Bootlin. Creative Commons BY-SA 3.0 license. Corrections, suggestions, contributions

More information

Number review... Lecture 3 Introduction to the C Programming Language (pt 1) Has there been an update to ANSI C?

Number review... Lecture 3 Introduction to the C Programming Language (pt 1) Has there been an update to ANSI C? CS61C L03 Introduction to C (pt 1) (1) inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture 3 Introduction to the C Programming Language (pt 1) 2008-01-28 Lecturer SOE Dan Garcia Hello to Dev

More information

LLVMLinux: x86 Kernel Build

LLVMLinux: x86 Kernel Build LLVMLinux: x86 Kernel Build Presented by: Jan-Simon Möller Presentation Date: 2012.08.30 Topics Common issues (x86 perspective) Specific Issues with Clang/LLVM Specific Issues with the Linux Kernel Status

More information

OpenMP and more Deadlock 2/16/18

OpenMP and more Deadlock 2/16/18 OpenMP and more Deadlock 2/16/18 Administrivia HW due Tuesday Cache simulator (direct-mapped and FIFO) Steps to using threads for parallelism Move code for thread into a function Create a struct to hold

More information

CS Introduction to Programming Midterm Exam #2 - Prof. Reed Fall 2015

CS Introduction to Programming Midterm Exam #2 - Prof. Reed Fall 2015 CS 141 - Introduction to Programming Midterm Exam #2 - Prof. Reed Fall 2015 You may take this test with you after the test, but you must turn in your answer sheet. This test has the following sections:

More information

Process Synchronization. Mehdi Kargahi School of ECE University of Tehran Spring 2008

Process Synchronization. Mehdi Kargahi School of ECE University of Tehran Spring 2008 Process Synchronization Mehdi Kargahi School of ECE University of Tehran Spring 2008 Producer-Consumer (Bounded Buffer) Producer Consumer Race Condition Producer Consumer Critical Sections Structure of

More information

UniSan: Proactive Kernel Memory Initialization to Eliminate Data Leakages

UniSan: Proactive Kernel Memory Initialization to Eliminate Data Leakages UniSan: Proactive Kernel Memory Initialization to Eliminate Data Leakages Kangjie Lu, Chengyu Song, Taesoo Kim, Wenke Lee School of Computer Science, Georgia Tech Any Problem Here? /* File: drivers/usb/core/devio.c*/

More information

Operational Semantics of Cool

Operational Semantics of Cool Operational Semantics of Cool Key Concepts semantics: the meaning of a program, what does program do? how the code is executed? operational semantics: high level code generation steps of calculating values

More information

The Spin Model Checker : Part I/II

The Spin Model Checker : Part I/II The Spin Model Checker : Part I/II Moonzoo Kim CS Dept. KAIST Korea Advanced Institute of Science and Technology Motivation: Tragic Accidents Caused by SW Bugs 2 Cost of Software Errors June 2002 Software

More information

Introduction to C. Sean Ogden. Cornell CS 4411, August 30, Geared toward programmers

Introduction to C. Sean Ogden. Cornell CS 4411, August 30, Geared toward programmers Introduction to C Geared toward programmers Sean Ogden Slide heritage: Alin Dobra Niranjan Nagarajan Owen Arden Robert Escriva Zhiyuan Teo Ayush Dubey Cornell CS 4411, August 30, 2013 Administrative Information

More information

An Introduction to the Video4Linux Framework

An Introduction to the Video4Linux Framework An Introduction to the Video4Linux Framework Hans Verkuil Cisco Systems Norway 2014 Cisco and/or its affiliates. All rights reserved. 1 Features & Architecture 2014 Cisco and/or its affiliates. All rights

More information

Computational Physics Operating systems

Computational Physics Operating systems Computational Physics numerical methods with C++ (and UNIX) 2018-19 Fernando Barao Instituto Superior Tecnico, Dep. Fisica email: fernando.barao@tecnico.ulisboa.pt Computational Physics 2018-19 (Phys Dep

More information

LOCKDEP, AN INSIDE OUT PERSPECTIVE. Nahim El

LOCKDEP, AN INSIDE OUT PERSPECTIVE. Nahim El LOCKDEP, AN INSIDE OUT PERSPECTIVE Nahim El Atmani @brokenpi_pe P1 R1 R1 P2 THE BIG PICTURE The need for a proof mechanism PREVIOUSLY ON LINUX SMP Synchronization needed giant-lock (a.k.a big-lock, kernel-lock

More information

Intro to C: Pointers and Arrays

Intro to C: Pointers and Arrays Lecture 4 Computer Science 61C Spring 2017 January 25th, 2017 Intro to C: Pointers and Arrays 1 Administrivia Teaching Assistants: Let s try that again. Lectures are recorded. Waitlist/Concurrent Enrollment

More information

An Introduction to the Video4Linux Framework

An Introduction to the Video4Linux Framework An Introduction to the Video4Linux Framework Hans Verkuil Cisco Systems Norway 2014 Cisco and/or its affiliates. All rights reserved. 1 Features & Architecture 2014 Cisco and/or its affiliates. All rights

More information

The benefits and costs of writing a POSIX kernel in a high-level language

The benefits and costs of writing a POSIX kernel in a high-level language 1 / 38 The benefits and costs of writing a POSIX kernel in a high-level language Cody Cutler, M. Frans Kaashoek, Robert T. Morris MIT CSAIL Should we use high-level languages to build OS kernels? 2 / 38

More information

EHCtor: Detecting Resource-Release Omission Faults in Error-Handling Code for Systems Software

EHCtor: Detecting Resource-Release Omission Faults in Error-Handling Code for Systems Software EHCtor: Detecting Resource-Release Omission Faults in Error-Handling Code for Systems Software Suman Saha, Jean-Pierre Lozi To cite this version: Suman Saha, Jean-Pierre Lozi. EHCtor: Detecting Resource-Release

More information

In Java we have the keyword null, which is the value of an uninitialized reference type

In Java we have the keyword null, which is the value of an uninitialized reference type + More on Pointers + Null pointers In Java we have the keyword null, which is the value of an uninitialized reference type In C we sometimes use NULL, but its just a macro for the integer 0 Pointers are

More information

CIS 190: C/C++ Programming. Lecture 2 Pointers and More

CIS 190: C/C++ Programming. Lecture 2 Pointers and More CIS 190: C/C++ Programming Lecture 2 Pointers and More Separate Compilation to prevent the file containing main() from getting too crowded and long function prototypes in their own file (functions.h) function

More information

ECGR 4101/5101, Fall 2016: Lab 1 First Embedded Systems Project Learning Objectives:

ECGR 4101/5101, Fall 2016: Lab 1 First Embedded Systems Project Learning Objectives: ECGR 4101/5101, Fall 2016: Lab 1 First Embedded Systems Project Learning Objectives: This lab will introduce basic embedded systems programming concepts by familiarizing the user with an embedded programming

More information

Zhifu Pei CSCI5448 Spring 2011 Prof. Kenneth M. Anderson

Zhifu Pei CSCI5448 Spring 2011 Prof. Kenneth M. Anderson Zhifu Pei CSCI5448 Spring 2011 Prof. Kenneth M. Anderson Introduction History, Characteristics of Java language Java Language Basics Data types, Variables, Operators and Expressions Anatomy of a Java Program

More information

System Administration and Network Security

System Administration and Network Security System Administration and Network Security Master SSCI, M2P subject Duration: up to 3 hours. All answers should be justified. Clear and concise answers will be rewarded. 1 Network Administration To keep

More information

CS 211 Programming Practicum Spring 2018

CS 211 Programming Practicum Spring 2018 Due: Thursday, 4/5/18 at 11:59 pm Infix Expression Evaluator Programming Project 5 For this lab, write a C++ program that will evaluate an infix expression. The algorithm REQUIRED for this program will

More information