Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

Linux Foundation

Writing Linux Kernel Modules in Safe Rust

Linux Foundation via YouTube

Overview

Explore the potential of using Rust for Linux kernel development in this 48-minute conference talk by Geoffrey Thomas and Alex Gaynor. Delve into the challenges of creating binary-compatible kernel modules in Rust, techniques for interfacing with existing C code, and strategies for designing safe bindings over raw kernel APIs. Learn about the advantages and difficulties of integrating Rust into upstream kernel development, and discover possible future directions for the kernel community. Gain insights into memory safety issues in kernel vulnerabilities and understand how Rust's safety features can address these concerns. Examine topics such as uninitialized variables, structs, traits, generics, error handling, and concurrency in the context of kernel module development. Investigate the practical aspects of compiling, binding, and mapping kernel APIs to Safe Rust, as well as real-world applications for out-of-tree module usage and improved kbuild integration.

Syllabus

Intro
Memory unsafety
49% - Chrome
72% - Firefox
70% - Microsoft
65% - Ubuntu
65% - Android
225 - Syzkaller
UAF Static Analysis
Hardening C
Isolation
What do we want out of our language?
A whirlwind tour of Rust, focusing on safety
Hello world!
Uninitialized variables
Structs
Traits
Generics and polymorphism
Trait objects and runtime polymorphism
Enums with data
Option and Result
Error handling
Panics and unwinding
Dangling references
Mutable references are unique references
Atomics
Safe and unsafe Rust
Compiling
Bindings
Mapping kernel APIs to Safe Rust
Heap allocations just work
What about _user pointers?
Concurrency!
FileOperations must be Sync!
Architecture support
Real world out-of-tree module usage?
Better kbuild integration

Taught by

Linux Foundation

Reviews

Start your review of Writing Linux Kernel Modules in Safe Rust

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.