Tag / Linux Kernel

  • SPDX

    December 1, 2017 - Mauro Carvalho Chehab

    Linux Kernel License Practices Revisited with SPDX®

    The licensing text in the Linux kernel source files is inconsistent in verbiage and format. Typically, in each of its ~100k files there is a license text that describes which license applies to each specific file. While all licenses are GPLv2 compatible, properly identifying the licenses that are applicable to a specific file is very hard. To address this problem, a group of developers recently embarked on a mission to use SPDX® to research and map these inconsistencies in the licensing text. As a result of this 10 month long effort, the Linux 4.14 release includes changes to make the licensing text consistent across the kernel source files and modules. Linux Kernel License As stated on its COPYING file, the Linux kernel’s default license is GPLv2, with an exception that grants additional rights to the kernel users:

    The kernel’s COPYING file produces two practical effects: User-space applications can use non-GPL […]

    Read More
  • A V4L2 staging driver for the Raspberry Pi (RPi) was recently merged into the Linux kernel 4.11. While this driver is currently under development, I wanted to test it and to provide help with V4L2-related issues. So, I took some time to build an upstream kernel for the Raspberry Pi 3 with V4L2 enabled. This isn’t a complex process, but it requires some tricks for it to work; this article describes the process. Prepare an Upstream Kernel The first step is to prepare an upstream kernel by cloning a git tree from the kernel repositories. Since the Broadcom 2835 camera driver (bcm2835-v4l2) is currently under staging, it’s best to clone the staging tree because it contains the staging/vc04_services directory with both ALSA and V4L2 drivers:

    There’s an extra patch that it is required for DT to work with the bcm2835-v4l2 driver:

    You need to apply this to the git tree, in order for the vciq […]

    Read More
  • October 28, 2016 - Mauro Carvalho Chehab

    Improving Linux Kernel Development Process Documentation

    This article will cover how the Linux kernel community handled the conversion of documentation related to the kernel development process; it’s part of a series on improvements being made to Linux kernel documentation. Introduction It’s not an easy task to properly describe the Linux development process. The kernel community moves at a very fast pace and produces about 6 versions per year. Thousands of people, distributed worldwide, contribute to this collective work; the development process is a live being that constantly adjusts to what best fits the people involved in the process. Additionally, since kernel development is managed per subsystems, each maintainer has their own criteria for what works best for the subsystem they take care of. To address this, the documentation provides a common ground for understanding the best practices all kernel developers should follow. The Documentation/Development-Process Book There are several files inside the kernel that describes the development […]

    Read More
  • The Next Generation Media Controller added several new interfaces to add and remove media graph objects. I started running tests with KASan enabled to detect dynamic memory errors introduced in this work, and I ended up finding some out-of-bounds address access and use-after-free bugs. This article will introduce you to KASan and provide some examples of how it can be valuable. What is KASan? Kernel Address sanitizer (KASan) is a dynamic memory error detector. It provides a fast and comprehensive solution for finding use-after-free and out-of-bounds bugs. KASan uses compile-time instrumentation to allocate shadow memory to keep track of out-of-bounds and use-after-free bugs. Each memory allocation gets the same area allocated in the shadow memory and accesses to allocated areas results in corresponding shadow memory accesses which then KASan flags when out-of-bounds access or use-after-free accesses occur. How to Use KASan The dependencies are: gcc 4.9.2 or later gcc 5.2 or later is required […]

    Read More