How to fix the Dirty COW vulnerability on Linux Ubuntu Systems. Canonical has patched Dirty COW Kernel Bug in all Ubuntu OSes and Ubuntu users urged to update their systems immediately. The Dirty COW vulnerability could have allowed local users to write any file they can only be read. The Dirty Cow security flaw was in various Linux Kernel since the release of Linux Kernel 2.6.x series.
Dirty COW (Dirty copy-on-write) is a computer security vulnerability for the Linux kernel that affects all Linux-based operating systems including Android.
Canonical’s CVE-2016-5195 document entitled “race condition in copy-on-write breakage of private read-only memory mappings” reads “It was discovered that a race condition existed in the memory manager of the Linux kernel when handling copy-on-write breakage of private read-only memory mappings. A local attacker could use this to gain administrative privileges.”
Linux Torvals writes “This is an ancient bug that was actually attempted to be fixed once (badly) by me eleven years ago in commit 4ceb5db9757a (“Fixget_user_pages() race for write access”) but that was then undone due to problems on s390 by commit f33ea7f404e5 (“fix get_user_pages bug”). The VM has become more scalable, and what used a purely theoretical race back then has become easier to trigger. To fix it, Canonical has introduced a new internal FOLL_COW flag to mark the “yes.” They have already did a COW” rather than play racy games with FOLL_WRITE that is very fundamental, and then use the pte dirty flag to validate that the FOLL_COW flag is still valid.
Canonical has already released the patch for Dirty COW Kernel Bug in all Ubuntu OSes and Ubuntu users urged to update their systems immediately. All Ubuntu users should patch their systems immediately by installing the latest Linux Kernel linux-image-4.8.0-26 (4.8.0-26.28) for Ubuntu 16.10, linux-image-4.4.0-45 (4.4.0-45.66) for Ubuntu 16.04 LTS, linux-image-3.13.0-100 (3.13.0-100.147) for Ubuntu 14.04 LTS, and linux-image-3.2.0-113 (3.2.0-113.155) for Ubuntu 12.04 LTS. The Raspberry Pi2 systems has also been notified to update and fix their systems with linux-image-4.4.0-1029-raspi2 (4.4.0-1029.36).
To update the Ubuntu Systems via command line, run the following commands in Terminal:
$ sudo apt-get update
$ sudo apt-get dist-upgrade
Once the system is updated, please restart the system to apply the changes.
You can read more about Dirty Cow here:
https://dirtycow.ninja/
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=19be0eaffa3ac7d8eb6784ad9bdbc7d67ed8e619
http://people.canonical.com/~ubuntu-security/cve/2016/CVE-2016-5195.html