Linux kernel security: check if you're vulnerable (Ubuntu/Rocky/SUSE), automation script, and mitigations if you can't reboot.
Originally published: April 12, 2026 (Rocky Linux RLSA-2026:6632)
Why this still matters: Kernel bugs like use-after-free, memory leaks, and DoS flaws are discovered every month. This guide gives you a repeatable process to detect, patch, or mitigate them – no matter when you read it.
In April 2026, a moderate kernel update for Rocky Linux 10 fixed several nasty issues:
- CVE-2025-38109 – use-after-free in mlx5 network driver (DoS)
- CVE-2026-23144 – memory leak in DAMON sysfs
- CVE-2026-23171 – use-after-free in bonding module (crash or code exec)
- CVE-2026-23193 – use-after-free in iSCSI target
- CVE-2026-23209 – broken error recovery in macvlan
- CVE-2026-23204 – packet handling flaw in cls_u32
- CVE-2026-23191 – race condition in ALSA loopback
But the same types of flaws happen again and again. Here’s how to handle them permanently.
1. How to check if you are vulnerable (actual commands)
Run these on your system today to see if you’re missing kernel fixes for known CVEs.
# Check current kernel version uname -r # List installed kernels and see if a security update is pending apt list --upgradable | grep linux-image # Check if a specific CVE is fixed (example) grep -i "CVE-2026-23171" /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz | zcat | head -1
Rocky Linux / RHEL / AlmaLinux
# Current kernel uname -r # Check available kernel security updates dnf check-update --security | grep kernel # List CVEs fixed by the currently running kernel rpm -q --changelog kernel-$(uname -r) | grep -i cve
SUSE Linux Enterprise / openSUSE
# Current kernel uname -r # List needed kernel patches zypper list-patches | grep -i kernel # Show if a specific CVE is patched zypper patch-info --cve=CVE-2026-23171
2. Automation script to apply the fix (bash, major distros)
#!/bin/bash # Kernel security updater – works on Ubuntu, Rocky, SUSE set -e DISTRO=$(grep ^ID= /etc/os-release | cut -d= -f2 | tr -d '"') echo "[*] Checking for kernel security updates on $DISTRO" case $DISTRO in ubuntu|debian) apt update apt install -y linux-image-generic ;; rocky|rhel|centos) dnf update-minimal --security -y kernel ;; suse|opensuse-leap|opensuse-tumbleweed) zypper patch --cve-classify=security ;; *) echo "Unsupported distro. Exiting." exit 1 ;; esac echo "[*] Kernel updated. Reboot required." echo "[*] Run: sudo reboot"
After reboot, verify:
uname -r grep "Kernel command line" /var/log/kern.log # check for boot errors
3. Alternative mitigation if you can’t update now
# Blacklist the bonding module echo "blacklist bonding" | sudo tee /etc/modprobe.d/disable-bonding.conf sudo rmmod bonding 2>/dev/null || true
For CVE-2025-38109 (mlx5 driver DoS) – block malicious traffic patterns
# iptables rate-limit to prevent trigger storms iptables -A INPUT -p tcp --dport 3185 -m limit --limit 10/minute -j ACCEPT iptables -A INPUT -p tcp --dport 3185 -j DROP
For CVE-2026-23204 (cls_u32 packet classifier)
# Restrict tc filter changes to root only echo "options cls_u32 enable_manual=0" | sudo tee /etc/modprobe.d/cls_u32.conf
cat << EOF | sudo tee /etc/apparmor.d/usr.sbin.iscsi-target /usr/sbin/targetcli { capability net_admin, capability sys_admin, deny /sys/kernel/config/target/** w, } EOF sudo apparmor_parser -r /etc/apparmor.d/usr.sbin.iscsi-target

Nenhum comentário:
Postar um comentário