Giter Site home page Giter Site logo

kabi-dw's Introduction

Synopsis

The aim of kabi-dw is to detect any changes in the ABI between the successive builds of the Linux kernel. This is done by dumping the DWARF type information (the .debug_info section) for the specific symbols into the text files and later comparing the text files.

Example

Build your kernel with CONFIG_DEBUG_INFO set:

git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
cd linux && git checkout v4.5
make allyesconfig
make

Get all the modules and vmlinux into single directory

make modules_install && cp vmlinux /usr/lib/modules/4.5.0

... build another kernel you want to compare to, lets say v4.6.

Build a list of symbols you want to monitor:

cat > symbols << EOF
init_task
schedule
dev_queue_xmit
__kmalloc
printk
EOF

Generate the type information for both kernels based on the current whitelist

./kabi-dw generate -s symbols -o kabi-4.5 /usr/lib/modules/4.5.0
./kabi-dw generate -s symbols -o kabi-4.6 /usr/lib/modules/4.6.0

Compare the two type dumps:

./kabi-dw compare kabi-4.5 kabi-4.6

Motivation

Traditionaly Unix System V had a stable ABI to allow external modules to work with the OS kernel without a recompilation called Device Driver Interface. Linux however never developed such stable kernel ABI. Therefore it's vital to monitor all kernel interfaces used by the external module for change, and if such change happens, the module needs to be recompiled.

Linux has an option (CONFIG_MODVERSIONS) to generate a checksum identifing all exported symbols thourhg the EXPORT_SYMBOL() macro. But these checksum are not sufficient to actually identify the scope of the change. For example changing a couple of unused padding bits in a structure to a new field won't break any external modules, but such change changes the chekcsum of any function which receives such structure through its arguments.

Installation

This program needs elfutils installed. Check out your distribution to figure out how to install elfutils.

For Fedora and CentOS 7 systems:

dnf install kabi-dw

For Ubuntu systems, you need to compile it. Install the dependencies:

sudo apt-get install elfutils

Then just make and run:

make
./kabi-dw

Contributors

Developed by Stanislav Kozina, Red Hat, Inc. with the help of others.

License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

kabi-dw's People

Contributors

jeromemarchand avatar ykaliuta avatar shoracek avatar sztsian avatar ksanagi avatar skozina avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.