Declare a mutex statically with DEFINE_MUTEX
Define a file-scope kernel mutex with DEFINE_MUTEX(name), which needs no mutex_init() call and is ready before module init runs, on Linux 6.x.
Short posts that solve one thing: the code, the output we got, and why it works.
Define a file-scope kernel mutex with DEFINE_MUTEX(name), which needs no mutex_init() call and is ready before module init runs, on Linux 6.x.
Register an interrupt handler with devm_request_irq() so the driver core frees the IRQ on unbind, and see the registered name in /proc/interrupts.
ioctl(kvm, KVM_CREATE_VM, 0) returns a new file descriptor for an empty VM. Pass 0 as the machine type on x86, which has no other values.
Add kernel options to a Yocto kernel with a .cfg fragment listed in SRC_URI of a linux-yocto bbappend on Scarthgap, without replacing the defconfig.
Use kzalloc(sizeof(*p), GFP_KERNEL) instead of kmalloc plus memset so new kernel structures never leak stale heap bytes to user space on Linux 6.x.
Read whether UEFI Secure Boot is active on a running Linux system with mokutil --sb-state, and see when shim has turned validation off.
Open /dev/kvm and call ioctl(fd, KVM_GET_API_VERSION, 0). It returns 12, and the docs tell programs to refuse any other value.
Create and wake a kernel thread in one call with kthread_run(), check the ERR_PTR return, and give it a name that shows up in ps on Linux 6.x.
Call prctl(PR_SET_NO_NEW_PRIVS) on Linux 3.5 or later so execve can never grant more privilege, which also lets unprivileged code install seccomp filters.
Silence one noisy dtc warning with -Wno-unit_address_vs_reg while keeping the other checks on, using dtc 1.7 flags on a board device tree.
Register a minimal platform driver with module_platform_driver on Linux 6.12, whose remove callback returns void since 6.11.
Setting bootdelay to -2 makes U-Boot boot at once without even checking for a key, which removes the console, on U-Boot 2025.01.
We send one email when a new post is published. No spam.