Rocky Linux 9 升级内核版本

近期收到云安全中心推送到的一条紧急漏洞信息后进行版本升级处理,目前官方源中没有更新到 kernel 6 以上版本,需要添加ELRepo后再进行在线更新内核,纯内网环境依旧建议采用编译方式进行升级。

CVE-2022-0847 漏洞基本信息


在线更新内核

[root@localhost ~]# cat /etc/redhat-release 
Rocky Linux release 9.1 (Blue Onyx)
[root@localhost ~]# uname -a
Linux localhost 5.14.0-70.30.1.el9_0.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 18 02:06:38 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux # Linux kernel 存在安全漏洞,该漏洞源于新管道缓冲区结构的“flag”变量在 Linux 内核中的 copy_page_to_iter_pipe 和 push_pipe 函数中缺乏正确初始化。非特权本地用户利用该漏洞可以提升权限至root。以下产品和版本受到影响:Linux Kernel 5.8-5.16.11、5.8-5.15.25、5.8-5.10.102。

[root@localhost ~]# rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org 
[root@localhost ~]# dnf install https://www.elrepo.org/elrepo-release-9.el9.elrepo.noarch.rpm # 安装ELRepo
[root@localhost ~]# dnf --disablerepo=\* --enablerepo=elrepo-kernel repolist # 载入elrepo-kernel元数据
[root@localhost ~]# dnf --disablerepo=\* --enablerepo=elrepo-kernel list kernel* # 查看可用内核包
[root@localhost ~]# dnf --disablerepo=\* --enablerepo=elrepo-kernel install -y kernel-ml.x86_64 # 安装最新版本的kernel
[root@localhost ~]# dnf remove kernel-tools-libs.x86_64 kernel-tools.x86_64 -y # 卸载旧版本内核工具包
[root@localhost ~]# dnf --disablerepo=\* --enablerepo=elrepo-kernel install -y kernel-ml-tools.x86_64 # 安装新版本内核工具包
[root@localhost ~]# grubby --info=ALL # 查看所有内核启动项
[root@localhost ~]# grubby --set-default 0 # 通过grub2-set-default 或通过 grubby --set-default 设置对应新内核启动项
The default is /boot/loader/entries/8af4948470fb462ab589216b40553a6e-6.1.1-1.el9.elrepo.x86_64.conf with index 0 and kernel /boot/vmlinuz-6.1.1-1.el9.elrepo.x86_64
[root@localhost ~]# reboot

[root@localhost ~]# uname -a
Linux localhost 6.1.1-1.el9.elrepo.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Dec 20 09:27:32 EST 2022 x86_64 x86_64 x86_64 GNU/Linux
上一篇
下一篇
/*
Theme Argon
*/