auto script in kernel src
https://github.com/torvalds/linux/blob/master/scripts/patch-kernel
~/src/kernel/linux-6.5.6/scripts/patch-kernel
~/src/kernel/linux-6.5.6/scripts/extract-vmlinux <kernel-image>
download incremental patch
https://cdn.kernel.org/pub/linux/kernel/v6.x/incr/patch-6.5.3-4.xz
xz --decompress patch-6.5.3-4.xz
cd linux-6.5.3/
patch -p1 < ../patch-6.5.3-4
head Makefile
# SPDX-License-Identifier: GPL-2.0
VERSION = 6
PATCHLEVEL = 5
SUBLEVEL = 4
cd ..
mv linux-6.5.3 linux-6.5.4
https://cdn.kernel.org/pub/linux/kernel/v6.x/incr/patch-6.5.4-5.xz
https://www.kernel.org/doc/html/latest/security/self-protection.html
http://kernsec.org/wiki/index.php/Kernel_Self_Protection_Project
git clone --depth=1 https://github.com/a13xp0p0v/kernel-hardening-checker
./bin/kernel-hardening-checker -c ~/src/kernel/linux-6.5.6/.config
cat ~/.bin/kpatch
patch -p1 < $1
cd kernel-stable
kpatch ../patch.file
https://www.kernel.org/
https://www.kernel.org/doc/html/next/process/applying-patches.html
Comments
Post a Comment