关于Linux TCP "SACK PANIC" 远程拒绝服务漏洞的修复

Linux 内核被曝存在TCP “SACK PANIC” 远程拒绝服务漏洞(漏洞编号:CVE-2019-11477,CVE-2019-11478,CVE-2019-11479),攻击者可利用该漏洞远程攻击目标服务器,导致系统崩溃或无法提供服务

漏洞详情

近日,腾讯云安全中心情报平台监测到 Netflix 信息安全团队研究员Jonathan Looney发现 Linux 以及 FreeBSD 等系统内核上存在严重远程DoS漏洞,攻击者可利用该漏洞构造并发送特定的 SACK 序列请求到目标服务器导致服务器崩溃或拒绝服务。

影响版本

目前已知受影响版本如下:

  1. FreeBSD 12(使用到 RACK TCP 协议栈)
  2. CentOS 5(Redhat 官方已停止支持,不再提供补丁)
  3. CentOS 6
  4. CentOS 7
  5. Ubuntu 18.04 LTS
  6. Ubuntu 16.04 LTS
  7. Ubuntu 19.04
  8. Ubuntu 18.10

安全版本

各大Linux发行厂商已发布内核修复补丁,没漏洞的内核版本如下:

  1. CentOS 6 :2.6.32-754.15.3
  2. CentOS 7 :3.10.0-957.21.3
  3. Ubuntu 18.04 LTS:4.15.0-52.56
  4. Ubuntu 16.04 LTS:4.4.0-151.178

修复方法

请参照上述【安全版本】升级您的 Linux 服务器内核,参考操作如下:

CentOS

推荐方案:【CentOS 6/7 系列用户】

  1. yum clean all && yum makecache,进行软件源更新;
  2. yum update kernel -y,更新当前内核版本;
  3. reboot,更新后重启系统生效;
  4. uname -a,检查当前版本是否为上述【安全版本】,如果是,则说明修复成功。

Ubuntu

推荐方案:【Ubuntu 16.04/18.04 LTS 系列用户】

  1. sudo apt-get update && sudo apt-get install linux-image-generic,进行软件源更新并安装最新内核版本;
  2. sudo reboot,更新后重启系统生效;
  3. uname -a,检查当前版本是否为【安全版本】,如果是,则说明修复成功。

Temp

临时缓解方案:如用户不方便重启进行内核补丁更新,可选择如下方式禁用内核 SACK配置防范漏洞利用(可能会对网络性能产生一定影响),运行如下命令即可:

  1. echo 'net.ipv4.tcp_sack = 0' >> /etc/sysctl.conf,禁用 SACK 配置;
  2. sysctl -p ,重载配置,使其生效。

参考

  1. 官方通告:https://github.com/Netflix/security-bulletins/blob/master/advisories/third-party/2019-001.md
  2. 社区参考:https://www.openwall.com/lists/oss-security/2019/06/17/5
  3. 红帽公告:https://access.redhat.com/security/vulnerabilities/tcpsack
  4. 腾讯公告:https://cloud.tencent.com/announce/detail/622

附录

我服务器是CentOS,所以以其为示例:

# 进行软件源更新
[root@VM_0_3_centos ~]# yum clean all && yum makecache
Loaded plugins: fastestmirror, langpacks
Cleaning repos: epel extras librehat-shadowsocks os updates
Cleaning up list of fastest mirrors
Loaded plugins: fastestmirror, langpacks
Determining fastest mirrors
epel                                                                                                                                | 5.3 kB  00:00:00
extras                                                                                                                              | 3.4 kB  00:00:00
librehat-shadowsocks                                                                                                                | 3.0 kB  00:00:00
os                                                                                                                                  | 3.6 kB  00:00:00
updates                                                                                                                             | 3.4 kB  00:00:00
(1/22): epel/7/x86_64/group_gz                                                                                                      |  88 kB  00:00:01
(2/22): epel/7/x86_64/updateinfo                                                                                                    | 978 kB  00:00:01
(3/22): epel/7/x86_64/prestodelta                                                                                                   |  717 B  00:00:00
(4/22): epel/7/x86_64/filelists_db                                                                                                  |  11 MB  00:00:06
(5/22): epel/7/x86_64/primary_db                                                                                                    | 6.8 MB  00:00:15
(6/22): epel/7/x86_64/updateinfo_zck                                                                                                | 1.4 MB  00:00:00
(6/22): epel/7/x86_64/updateinfo_zck                                                                                                | 1.4 MB  00:00:00
(6/22): epel/7/x86_64/updateinfo_zck                                                                                                | 1.4 MB  00:00:00
(6/22): epel/7/x86_64/updateinfo_zck                                                                                                | 1.4 MB  00:00:00
(6/22): epel/7/x86_64/updateinfo_zck                                                                                                | 1.4 MB  00:00:00
(7/22): extras/7/x86_64/prestodelta                                                                                                 |  65 kB  00:00:01
(8/22): extras/7/x86_64/primary_db                                                                                                  | 205 kB  00:00:01
(9/22): extras/7/x86_64/other_db                                                                                                    | 127 kB  00:00:00
(10/22): librehat-shadowsocks/x86_64/filelists_db                                                                                   |  17 kB  00:00:00
(11/22): librehat-shadowsocks/x86_64/primary_db                                                                                     |  23 kB  00:00:00
(12/22): librehat-shadowsocks/x86_64/other_db                                                                                       |  10 kB  00:00:00
(13/22): os/7/x86_64/group_gz                                                                                                       | 166 kB  00:00:00
(14/22): os/7/x86_64/primary_db                                                                                                     | 6.0 MB  00:00:03
(15/22): os/7/x86_64/filelists_db                                                                                                   | 7.1 MB  00:00:05
(16/22): os/7/x86_64/other_db                                                                                                       | 2.6 MB  00:00:00
(17/22): updates/7/x86_64/prestodelta                                                                                               | 797 kB  00:00:00
(18/22): updates/7/x86_64/primary_db                                                                                                | 6.4 MB  00:00:01
(19/22): updates/7/x86_64/other_db                                                                                                  | 641 kB  00:00:00
(20/22): updates/7/x86_64/filelists_db                                                                                              | 4.4 MB  00:00:05
epel/7/x86_64/other_db
http://mirrors.tencentyun.com/epel/7/x86_64/repodata/24838144a5b86bb0cd90b22255258aeed11691115ae3c35463e471cbae0f2ab9-other.sqlite.bz2: [Errno 12] Timeout on http://mirrors.tencentyun.com/epel/7/x86_64/repodata/24838144a5b86bb0cd90b22255258aeed11691115ae3c35463e471cbae0f2ab9-other.sqlite.bz2: (28, 'Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds')
Trying other mirror.
(21/22): extras/7/x86_64/filelists_db                                                                                              | 246 kB  00:00:26
(22/22): epel/7/x86_64/other_db                                                                                                    | 3.2 MB  00:00:12
Metadata Cache Created

# 更新内核
[root@VM_0_3_centos ~]# yum update kernel  -y
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package kernel.x86_64 0:3.10.0-957.21.3.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=======================================================================================================================================================================
 Package                                        Arch                                           Version                                                      Repository                                       Size
=======================================================================================================================================================================
Installing:
 kernel                                         x86_64                                         3.10.0-957.21.3.el7                                          updates                                          48 M

Transaction Summary
=======================================================================================================================================================================
Install  1 Package

Total download size: 48 M
Installed size: 63 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
kernel-3.10.0-957.21.3.el7.x86_64.rpm                                                          |  48 MB  00:00:11
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : kernel-3.10.0-957.21.3.el7.x86_64                                                1/1 
  Verifying  : kernel-3.10.0-957.21.3.el7.x86_64                                                1/1 

Installed:
  kernel.x86_64 0:3.10.0-957.21.3.el7

Complete!

# 重启
[root@VM_0_3_centos ~]# reboot

# 查看内核版本是否为最新的`3.10.0-957.21.3`
[root@VM_0_3_centos ~]# uname -a
Linux VM_0_3_centos 3.10.0-957.21.3.el7.x86_64 #1 SMP Tue Jun 18 16:35:19 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
posted @ 2019-06-30 21:40 毒逆天 阅读(...) 评论(...) 编辑 收藏
/* 置顶 */