Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2026-53359-Kernel-Fix — Linux 内核升级指南 - 修复 CVE-2026-53359 | Kitploit
Tools/GitHubGitHub/chuzhongyun/cve-2026-53359-kernel-fix
Cloud Infrastructure SecurityVulnerability AnalysisLearning & Education
GitHubchuzhongyun/cve-2026-53359-kernel-fix

CVE-2026-53359-Kernel-Fix

Linux 内核升级指南 - 修复 CVE-2026-53359

View Repository

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
2172 months agoNot yet reviewed
Share

中文 | English


中文

升级 Linux Kernel 7.1.3 修复 CVE-2026-53359 教程

声明: 本文仅记录本人服务器环境下的修复过程,并非安全专业分析。如有不当之处,欢迎指正。

验证说明: 经源码比对确认,Linux Kernel 7.1.3 已包含修复 commit 81ccda30b4e8("KVM: x86: Fix shadow paging use-after-free due to unexpected role"),该补丁在 arch/x86/kvm/mmu/mmu.c 的 kvm_mmu_get_child_sp() 函数中增加了 role.word 匹配条件,从根本上消除了因 role 不匹配导致的 shadow paging UAF。因此,升级至 7.1.3 可以有效修复此漏洞。

1. 简介

本文档提供两种方式将 Linux Kernel 升级至 7.1.3,用于修复 CVE-2026-53359:ELRepo RPM 安装(推荐)和源码编译。

项目说明
CVE 编号CVE-2026-53359
漏洞组件Linux Kernel KVM x86 Shadow MMU
漏洞类型Use After Free (UAF)
修复方式升级 Linux Kernel 至 7.1.3(ELRepo RPM 或源码编译)

漏洞影响:

KVM x86 Shadow Paging 场景中,异常情况下可能出现释放后的页面仍被 rmap 条目引用,引发内存安全问题。

漏洞参考:

  • NVD - CVE-2026-53359
  • Januscape - PoC

2. 环境信息

项目信息
系统CentOS Stream 8
升级前内核6.18.8-1.el8.elrepo.x86_64
升级后内核7.1.3
架构x86_64
虚拟化KVM Intel

查看当前环境:

root@kitploit:~
cat /etc/os-release
uname -r

3. 升级方法

本教程提供两种升级方式,可根据环境选择:

方法一:ELRepo RPM 安装(推荐)

适用于能正常访问 ELRepo 仓库的环境,无需编译,操作简单。

root@kitploit:~
# 导入 ELRepo GPG 密钥
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org

# 安装 ELRepo 仓库
dnf install https://www.elrepo.org/elrepo-release-8.el8.elrepo.noarch.rpm

# 安装最新主线内核
dnf --enablerepo=elrepo-kernel install kernel-ml

# 设置新内核为默认启动项
grubby --set-default /boot/vmlinuz-7.1.3-1.el8.elrepo.x86_64

# 重启生效
reboot

注意: 内核版本号可能因 ELRepo 更新而变化,请以实际安装的版本为准。安装后可用 ls /boot/vmlinuz-* 查看。

方法二:源码编译

适用于无法访问 ELRepo 仓库,或需要使用 kernel.org 官方 stable 版本的环境。具体步骤见下方。


4. 源码编译步骤

由于本人服务器环境中:

  • ELRepo Kernel RPM 仓库无法稳定拉取;
  • 未找到适合当前环境的 RPM 更新包;
  • 需要直接使用 Linux Kernel 官方 stable 修复版本;

因此采用:

kernel.org 官方 stable 源码编译方式升级内核。

说明:

该方案仅为本人服务器环境下的解决方法,不代表所有环境必须使用源码编译。


5. 下载源码

官方下载:

root@kitploit:~
https://cdn.kernel.org/pub/linux/kernel/v7.x/linux-7.1.3.tar.xz

下载命令:

root@kitploit:~
wget https://cdn.kernel.org/pub/linux/kernel/v7.x/linux-7.1.3.tar.xz

上传位置(离线环境):

root@kitploit:~
/root/linux-7.1.3.tar.xz

6. 安装编译依赖

root@kitploit:~
dnf groupinstall "Development Tools" -y

dnf install -y \
  ncurses-devel \
  elfutils-libelf-devel \
  openssl-devel \
  bc \
  bison \
  flex \
  perl \
  dwarves

7. 解压源码

root@kitploit:~
mkdir -p /usr/src
cd /usr/src
tar -xf /root/linux-7.1.3.tar.xz
cd linux-7.1.3
ls Makefile  # 应显示: Makefile

8. 使用现有配置

root@kitploit:~
# 复制当前配置
cp /boot/config-$(uname -r) .config

# 生成新配置
make olddefconfig

# 检查 KVM 配置
grep -E "CONFIG_KVM|CONFIG_KVM_INTEL" .config

预期输出:

root@kitploit:~
CONFIG_KVM=m
CONFIG_KVM_X86=m
CONFIG_KVM_INTEL=m

9. 编译内核

root@kitploit:~
# 查看 CPU 线程数
nproc

# 编译(使用所有核心)
make -j$(nproc)

# 验证内核镜像
ls -lh arch/x86/boot/bzImage

注意: 编译时间取决于 CPU 和存储性能。


10. 安装内核模块

root@kitploit:~
# 安装模块
make modules_install

# 验证安装
ls /lib/modules/

# 检查 KVM 模块
find /lib/modules/7.1.3 -name "kvm*.ko*"

预期输出:

root@kitploit:~
kvm.ko
kvm-intel.ko
kvm-amd.ko

11. 安装内核镜像

root@kitploit:~
# 安装内核
make install

# 验证安装
ls -lh /boot | grep 7.1.3

预期输出:

root@kitploit:~
vmlinuz-7.1.3
initramfs-7.1.3.img
System.map-7.1.3

12. 更新启动项

root@kitploit:~
# 生成 GRUB 配置
grub2-mkconfig -o /boot/grub2/grub.cfg

# 设置默认内核
grubby --set-default /boot/vmlinuz-7.1.3

# 验证默认内核
grubby --default-kernel

预期输出:

root@kitploit:~
/boot/vmlinuz-7.1.3

13. 重启

root@kitploit:~
reboot

14. 验证

查看内核版本:

root@kitploit:~
uname -r
# 预期: 7.1.3

查看 KVM 模块:

root@kitploit:~
lsmod | grep kvm
# 预期: kvm_intel, kvm, irqbypass

验证 KVM 模块位置:

root@kitploit:~
modinfo kvm_intel | grep filename
# 预期: /lib/modules/7.1.3/kernel/arch/x86/kvm/kvm-intel.ko

15. 回滚

重要: 旧内核不应立即删除。

列出可用内核:

root@kitploit:~
grubby --info=ALL | grep kernel

如果新内核有问题,设置旧内核:

root@kitploit:~
grubby --set-default /boot/vmlinuz-6.18.8-1.el8.elrepo.x86_64
reboot

16. 最终结果

项目升级前升级后
内核版本6.18.8-1.el8.elrepo.x86_647.1.3
KVM 状态N/A已启用
CVE-2026-53359受影响已修复


English

Upgrading Linux Kernel to 7.1.3 to Fix CVE-2026-53359

Disclaimer: This repository only documents my personal fix process on a specific server environment. It is not a professional security analysis. Corrections are welcome.

Verification Note: Source code comparison confirms that Linux Kernel 7.1.3 includes the fix commit 81ccda30b4e8 ("KVM: x86: Fix shadow paging use-after-free due to unexpected role"). The patch adds a role.word matching condition in the kvm_mmu_get_child_sp() function in arch/x86/kvm/mmu/mmu.c, eliminating the shadow paging UAF caused by role mismatch. Therefore, upgrading to 7.1.3 effectively remediates this vulnerability.

1. Introduction

This guide provides two methods to upgrade Linux Kernel to 7.1.3 for fixing CVE-2026-53359: ELRepo RPM installation (recommended) and building from source.

ItemDescription
CVE IDCVE-2026-53359
Affected ComponentLinux Kernel KVM x86 Shadow MMU
Vulnerability TypeUse After Free (UAF)
Fix MethodUpgrade Linux Kernel to 7.1.3 (ELRepo RPM or build from source)

The vulnerability is related to KVM x86 shadow paging. Under specific conditions, freed pages may still be referenced by rmap entries, causing a potential memory safety issue.

References:

  • NVD - CVE-2026-53359
  • Januscape - PoC

2. Environment

ItemValue
OSCentOS Stream 8
Old Kernel6.18.8-1.el8.elrepo.x86_64
New Kernel7.1.3
Architecturex86_64
VirtualizationKVM Intel
CompilerGCC 8.5

Check current environment:

root@kitploit:~
cat /etc/os-release
uname -r

3. Upgrade Methods

This guide provides two upgrade methods. Choose based on your environment:

Method A: ELRepo RPM Installation (Recommended)

For environments with reliable access to the ELRepo repository. No compilation required.

root@kitploit:~
# Import ELRepo GPG key
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org

# Install ELRepo repository
dnf install https://www.elrepo.org/elrepo-release-8.el8.elrepo.noarch.rpm

# Install latest mainline kernel
dnf --enablerepo=elrepo-kernel install kernel-ml

# Set new kernel as default boot entry
grubby --set-default /boot/vmlinuz-7.1.3-1.el8.elrepo.x86_64

# Reboot to apply
reboot

Note: Kernel version numbers may change with ELRepo updates. Check actual installed version with ls /boot/vmlinuz-*.

Method B: Build from Source

For environments without ELRepo access, or when the official kernel.org stable release is required. See detailed steps below.


4. Build from Source Steps

In my environment:

  • ELRepo Kernel RPM repository could not be accessed reliably.
  • I did not find another suitable RPM update method.
  • I needed to deploy the official Linux Kernel stable release.

Therefore:

I used the official kernel.org stable source code and built Kernel 7.1.3 manually.

Note:

This is my own environment solution, not a mandatory upgrade method for all systems.


5. Download Kernel Source

Official source:

root@kitploit:~
https://cdn.kernel.org/pub/linux/kernel/v7.x/linux-7.1.3.tar.xz

Download:

root@kitploit:~
wget https://cdn.kernel.org/pub/linux/kernel/v7.x/linux-7.1.3.tar.xz

Upload location (if offline):

root@kitploit:~
/root/linux-7.1.3.tar.xz

6. Install Build Dependencies

root@kitploit:~
dnf groupinstall "Development Tools" -y

dnf install -y \
  ncurses-devel \
  elfutils-libelf-devel \
  openssl-devel \
  bc \
  bison \
  flex \
  perl \
  dwarves \
  tar \
  xz

Verify compiler:

root@kitploit:~
gcc --version

7. Extract Source Code

root@kitploit:~
mkdir -p /usr/src
cd /usr/src
tar -xf /root/linux-7.1.3.tar.xz
cd linux-7.1.3
ls Makefile  # Should show: Makefile

8. Import Existing Kernel Configuration

root@kitploit:~
# Copy current kernel configuration
cp /boot/config-$(uname -r) .config

# Generate new configuration
make olddefconfig

# Verify KVM configuration
grep -E "CONFIG_KVM|CONFIG_KVM_INTEL" .config

Expected output:

root@kitploit:~
CONFIG_KVM=m
CONFIG_KVM_X86=m
CONFIG_KVM_INTEL=m

9. Compile Kernel

root@kitploit:~
# Check CPU threads
nproc

# Compile (use all available cores)
make -j$(nproc)

# Verify kernel image
ls -lh arch/x86/boot/bzImage

Note: Compilation time depends on CPU and storage performance.


10. Install Kernel Modules

root@kitploit:~
# Install modules
make modules_install

# Verify installation
ls /lib/modules/

# Check KVM modules
find /lib/modules/7.1.3 -name "kvm*.ko*"

Expected output:

root@kitploit:~
kvm.ko
kvm-intel.ko
kvm-amd.ko

11. Install Kernel Image

root@kitploit:~
# Install kernel
make install

# Verify installation
ls -lh /boot | grep 7.1.3

Expected output:

root@kitploit:~
vmlinuz-7.1.3
initramfs-7.1.3.img
System.map-7.1.3

12. Configure GRUB Bootloader

root@kitploit:~
# Generate GRUB configuration
grub2-mkconfig -o /boot/grub2/grub.cfg

# Set default kernel
grubby --set-default /boot/vmlinuz-7.1.3

# Verify default kernel
grubby --default-kernel

Expected output:

root@kitploit:~
/boot/vmlinuz-7.1.3

13. Reboot

root@kitploit:~
reboot

14. Verification After Reboot

Check kernel version:

root@kitploit:~
uname -r
# Expected: 7.1.3

Check KVM modules:

root@kitploit:~
lsmod | grep kvm
# Expected: kvm_intel, kvm, irqbypass

Verify KVM module location:

root@kitploit:~
modinfo kvm_intel | grep filename
# Expected: /lib/modules/7.1.3/kernel/arch/x86/kvm/kvm-intel.ko

15. Rollback Procedure

Important: Old kernels should not be removed immediately.

List available kernels:

root@kitploit:~
grubby --info=ALL | grep kernel

If the new kernel has issues, set old kernel:

root@kitploit:~
grubby --set-default /boot/vmlinuz-6.18.8-1.el8.elrepo.x86_64
reboot

16. Final Result

ItemBeforeAfter
Kernel Version6.18.8-1.el8.elrepo.x86_647.1.3
KVM StatusN/AEnabled
CVE-2026-53359VulnerableRemediated

许可证 / License

MIT

Download Tool