Linux kernel security: Two local privilege escalation flaws (CVE-2025-40309, CVE-2026-23268) affect Bluetooth & AppArmor. Learn to check, patch, or mitigate on Ubuntu, Rocky, SUSE. Includes automation script & affiliate resource.
This guide remains valid for any Linux system running kernel versions with the vulnerable Bluetooth SCO stack or AppArmor policy management logic.
The Short Version
Two local privilege escalation (LPE) vulnerabilities were found in the Linux kernel:
- CVE-2025-40309 (CVSS 7.8): Use-after-free (UAF) in the Bluetooth SCO (Synchronous Connection-Oriented) link handling – sco_conn_free.
- CVE-2026-23268 (CVSS 7.8): AppArmor flaw allowing an unprivileged local user to manage security policies they should not touch.
The real-world risk: Any local user (or malware running as a low-privilege user) could gain full root access. No remote exploit – but dangerous on shared hosting, student labs, or any multi-user server.
How to Check if You Are Vulnerable
uname -r # Fixed version example: 6.8.0-31-generic (depends on your release) # Check for backported patch: apt list --installed | grep linux-image # Check if AppArmor is affected (will be fixed by kernel patch, not userspace) aa-status --pretty-json | grep -i "policy"
uname -r # Fixed in kernel-5.14.0-427.13.1.el9_4 or higher (example) rpm -q kernel-core # Look for backported fix in changelog: rpm -q --changelog kernel-core | grep -E 'CVE-2025-40309|CVE-2026-23268'
uname -r # Vulnerable: 6.4.0-150700.53.6 and earlier zypper patches | grep SUSE-SLE-Module-Live-Patching-15-SP7-2026-1456 # Check if livepatch is already applied: zypper patches --all | grep "livepatch"
Automation Script to Apply the Fix (Bash, multi-distro)
#!/bin/bash # Linux Kernel LPE Fix: CVE-2025-40309 & CVE-2026-23268 # Supports: Ubuntu (apt), Rocky (dnf), SUSE (zypper) set -e DISTRO=$(grep '^ID=' /etc/os-release | cut -d= -f2 | tr -d '"') echo "[*] Detected: $DISTRO" case $DISTRO in ubuntu|debian) apt update apt upgrade -y linux-image-$(uname -r | cut -d- -f1) linux-headers-$(uname -r) echo "[*] Reboot required: systemctl reboot" ;; rocky|rhel|centos) dnf update -y kernel kernel-core echo "[*] Reboot required: systemctl reboot" ;; suse|opensuse-leap) zypper patch --cve=CVE-2025-40309 --cve=CVE-2026-23268 -y # Alternative: apply livepatch without reboot zypper install -y kernel-livepatch-SLE15-SP7_Update_2 systemctl enable --now kgraftd echo "[*] Livepatch applied. No reboot needed if using livepatch." ;; *) echo "Unsupported distro. Manually compile kernel with commits:" echo "Bluetooth: commit d94e7b6f5c (SCO UAF fix)" echo "AppArmor: commit 1a9a4f82de (policy management fix)" ;; esac echo "[✓] Patching complete. Reboot or confirm with: uname -r"
Alternative Mitigation If You Can’t Update Now
# Blacklist the SCO module (effective after reboot) echo "blacklist bluetooth" | sudo tee /etc/modprobe.d/disable-bluetooth.conf # Or remove it now (will break any Bluetooth devices): sudo rmmod bluetooth
# Ubuntu/Debian echo "kernel.unprivileged_userns_clone=0" >> /etc/sysctl.d/99-disable-userns.conf # Rocky/SUSE echo "user.max_user_namespaces=0" >> /etc/sysctl.d/99-disable-userns.conf sysctl -p /etc/sysctl.d/99-disable-userns.conf

Nenhum comentário:
Postar um comentário