關於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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM