On October 19, 2016, a privilege escalation vulnerability in the Linux kernel was disclosed. The bug is nicknamed Dirty COW because the underlying issue was a race condition in the way kernel handles copy-on-write (COW). Dirty COW has existed for a long time — at least since 2007, with kernel version 2.6.22 — so the vast majority of servers are at risk.
Exploiting this bug means that a regular, unprivileged user on your server can gain write access to any file they can read, and can therefore increase their privileges on the system. More information can be found on CVE-2016-5195 from Canonical, Red Hat, and Debian.
Fortunately, most major distributions have already released a fix. All of the base images on DigitalOcean have been updated to include the patched kernel versions, so future Droplets you create will not need to be updated. However, if you’re running an older server, you can follow this tutorial make sure you’re protected.
To find out if your server is affected, check your kernel version.
- uname -rv
You’ll see output like this:
Output4.4.0-42-generic #62-Ubuntu SMP Fri Oct 7 23:11:45 UTC 2016
If your version is earlier than the following, you are affected:
Some versions of CentOS can use this script provided by RedHat for RHEL to test your server’s vulnerability. To try it, first download the script.
- wget https://access.redhat.com/sites/default/files/rh-cve-2016-5195_1.sh
Then run it with bash
.
- bash rh-cve-2016-5195_1.sh
If you’re vulnerable, you’ll see output like this:
OutputYour kernel is 3.10.0-327.36.1.el7.x86_64 which IS vulnerable.
Red Hat recommends that you update your kernel. Alternatively, you can apply partial
mitigation described at https://access.redhat.com/security/vulnerabilities/2706661 .
Fortunately, applying the fix is straightforward: update your system and reboot your server.
On Ubuntu and Debian, upgrade your packages using apt-get
.
- sudo apt-get update && sudo apt-get dist-upgrade
You can update all of your packages on CentOS 5, 6, and 7 with sudo yum update
, but if you only want to update the kernel to address this bug, run:
- sudo yum update kernel
On older Droplets with external kernel management, you’ll also need to select the DigitalOcean GrubLoader kernel. To do this, go to the control panel, click on the server you want to update. Then, click Kernel in the menu on the left and choose the GrubLoader kernel. You can learn more about updating your Droplet’s kernel in this kernel management tutorial. Newer Droplets with internal kernel management can skip this step.
Finally, on all distributions, you’ll need to reboot your server to apply the changes.
- sudo reboot
Make sure to update your Linux servers to stay protected from this privilege escalation bug.
Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
To folks on older Ubuntu versions having issues: please note that on older Droplets, you’ll need to select DigitalOcean GrubLoader kernel so it will actually load the new kernel version configured in Grub. I’ve updated the tutorial to include instructions for this.
I had trouble updating a number of my droplets and ultimately discovered this article on how DO handles kernel updates. Hope it helps.
Holy shit.
Was this emailed out to droplet owners???
If not, yall really dropped the ball.
Just learning about this. Patched, now. SMH…
Does someone know a tool with who I can upgrade and manage 40 servers at a time? I am sick of this loggin in and out of ssh,
Looks like they finally released a patch for CentOS 5: 2.6.18-416. I’m going to bounce my servers this evening to get the change in effect. Here is the change log back to the previous version in the repos (412):
I am on Debian 8 with kernel:
When I
dist-upgrade
it says everything is up to date Listing the kernels gives:So I did:
But it is still
3.2.0-4-amd64 #1 SMP Debian 3.2.41-2+deb7u2
How do I fix this?
Okay, just making change kernel used on the panel, fix this bug? last 3.13.0-29-generic, the new kernel change 3.19.0-58-generic
Fix for CentOS 6 was released: kernel-2.6.32-642.6.2.el6.i686.rpm
Hi, it seems there is no official patches for Centos 6? I was followed this guide https://bugzilla.redhat.com/show_bug.cgi?id=1384344
How can I check again? please check for me in http://torrent4all.com movies torrent server?
Recently released Centos 7.2 kernel-3.10.0-327.36.3.el7.x86_64 seems fixed it, shows now: