问题介绍:https://mp.weixin.qq.com/s/rQqox72o5Vp2FnCDmgfaHw
CentOS 8.5,内核 4.18.0-348.el8 ,受 CVE-2026-31431 高危影响 ;CentOS 8 官方已停更、无官方补丁,需做:先临时阻断 → 再升级修复内核 → 重启 → 加固。
一、紧急临时缓解(立刻执行,root)
1. 永久禁用 algif_aead(重启仍生效)
echo "install algif_aead /bin/false" > /etc/modprobe.d/disable-algif-aead.conf
2. 卸载已加载模块 rmmod algif_aead 2>/dev/null
3. 验证:无输出即成功 lsmod | grep algif_aead
二、修复方案
迁移到兼容发行版(长期稳定)
CentOS 8 → Rocky Linux 8 / AlmaLinux 8(官方已发布修复补丁)。
1. 先清空所有 repo(彻底干净)
rm -rf /etc/yum.repos.d/*
2. 一键创建 纯 vault 源(无 mirrorlist,绝对能用)
cat > /etc/yum.repos.d/CentOS-Vault.repo <<'EOF'
[baseos]
name=CentOS Linux 8 - BaseOS
baseurl=http://vault.centos.org/8.5.2111/BaseOS/x86_64/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
[appstream]
name=CentOS Linux 8 - AppStream
baseurl=http://vault.centos.org/8.5.2111/AppStream/x86_64/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
[extras]
name=CentOS Linux 8 - Extras
baseurl=http://vault.centos.org/8.5.2111/extras/x86_64/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
EOF
3. 清理缓存 + 重建
dnf clean all
dnf makecache
成功标志
CentOS Linux 8 - BaseOS
CentOS Linux 8 - AppStream
CentOS Linux 8 - Extras
元数据缓存已建立。
4、用 AlmaLinux 迁移(最稳,不挑环境)
cd /tmp
curl -O https://raw.githubusercontent.com/AlmaLinux/almalinux-deploy/master/almalinux-deploy.sh
chmod +x almalinux-deploy.sh
bash almalinux-deploy.sh
5、重启系统生效//根据业务情况处置!!!
reboot
6、验证迁移成功 + 修复 CVE-2026-31431 漏洞
cat /etc/redhat-release
# 输出:AlmaLinux release 8.10 (Cerulean Parchment)
uname -r
# 内核版本 >= 4.18.0-513.5.1.el8_10 即已修复 CVE-2026-31431