# Dirty Cow vulnerability

**URL:** <https://community.openenergymonitor.org/t/dirty-cow-vulnerability/2010>\
**Category:** Emoncms\
**Created:** [27 October 2016 14:26 UTC](https://community.openenergymonitor.org/t/dirty-cow-vulnerability/2010 "2016-10-27T14:26:20Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bill.Thomson](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/bill.thomson/32/1834_2.png) [@Bill.Thomson](https://community.openenergymonitor.org/u/Bill.Thomson)\
**Post date:** [27 October 2016 14:26 UTC](https://community.openenergymonitor.org/t/dirty-cow-vulnerability/2010/1 "2016-10-27T14:26:20Z")

</div>

Dirty Cow (Copy On Write) affects anyone using any variant of Linux, including Android.

Here’s a couple of links with more info:

> **[How Bad Is Dirty COW? - Linux.com](https://www.linux.com/news/how-bad-dirty-cow/)**
>
> “Dirty COW” is a serious Linux kernel vulnerability that was recently discovered to have been lurking in the code for more than nine years. It is pretty much guaranteed that if you’re using any version of Linux or Android released in the past decade,...

> **[9 Year Old Linux Kernel bug dubbed 'Dirty Cow' can Root every version of Android](https://www.xda-developers.com/9-year-old-linux-kernel-bug-dubbed-dirty-cow-can-root-every-version-of-android/)**
>
> Dirty Cow is a newly discovered, but 9-year-old bug that can be exploited to grant root access on all versions of Android.

---

<div class="post-metadata">

**Author:** ![Jon](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/jon/32/1876_2.png) [@Jon](https://community.openenergymonitor.org/u/Jon)\
**Post date:** [27 October 2016 14:45 UTC](https://community.openenergymonitor.org/t/dirty-cow-vulnerability/2010/2 "2016-10-27T14:45:25Z")

</div>

more info (from spongebob?!?):

> <https://github.com/raspberrypi/linux/issues/1694>
>
> Hi,
> 
> I'm running raspbian jessie with
> 
> \`\`\`
> Linux pi 3.18.0-trunk-rpi #1 PREEMPT …Debian 3.18.5-1~exp1+rpi19 (2015-08-08) armv6l GNU/Linux
> \`\`\`
> 
> I'm unsure whether this protects me from the recently discovered security relevant bug CVE-2016-5195 (aka dirty COW, \[debian bug\](https://security-tracker.debian.org/tracker/CVE-2016-5195), \[more information\](http://dirtycow.ninja/)), since the debian bug does not list the kernel version I am running. Could you give information what kernel version is not affected?
> 
> Many thanks,
> silberzwiebel

---

<div class="post-metadata">

**Author:** ![pb66](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/pb66/32/27_2.png) [@pb66](https://community.openenergymonitor.org/u/pb66)\
**Post date:** [27 October 2016 16:17 UTC](https://community.openenergymonitor.org/t/dirty-cow-vulnerability/2010/3 "2016-10-27T16:17:44Z")

</div>

You can check the kernel version on the admin page of emoncms or using `uname -r` at the command prompt of other (non-emoncms server) Pi’s. The patch is applied from 4.4.26-v7+.

Although _apparently_ just

sudo apt-get update  
sudo apt-get dist-upgrade

will do, the official advice from the foundation is to use

sudo apt-get update  
sudo apt-get install raspberrypi-kernel

…AND REBOOT!!

The new kernel will not get loaded until it is restarted.

This assumes a Raspbian OS image, I haven’t looked into any others.

> **[Fix Dirty COW on the Raspberry Pi - Raspberry Pi](https://www.raspberrypi.com/news/fix-dirty-cow-raspberry-pi/)**
>
> Hi gang, Rob from The MagPi here. We have a new issue out on Thursday but before that, here comes a PSA. You may have seen the news recently about a bug in the Linux kernel called Dirty COW – it’s a vulnerability that affects the ‘copy-on-write’...

---

<div class="post-metadata">

**Author:** ![glyn.hudson](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/glyn.hudson/32/35003_2.png) [@glyn.hudson](https://community.openenergymonitor.org/u/glyn.hudson)\
**Post date:** [27 October 2016 16:26 UTC](https://community.openenergymonitor.org/t/dirty-cow-vulnerability/2010/4 "2016-10-27T16:26:11Z")

</div>

I can confirm that just

```auto
sudo apt-get update
sudo apt-get dist-upgrade

```

Will get you `4.4.26-v7+` on our emonPi Jessie image,and it doesn’t break anything!

---

<div class="post-metadata">

**Author:** ![Jon](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/jon/32/1876_2.png) [@Jon](https://community.openenergymonitor.org/u/Jon)\
**Post date:** [27 October 2016 18:00 UTC](https://community.openenergymonitor.org/t/dirty-cow-vulnerability/2010/5 "2016-10-27T18:00:29Z")

</div>

to get the current OS version:  
~~to get the current Linux version for the emonPi image~~  
**Log In** \> go to the **Setup** menu \> click on **Administration**. Scroll down to **Server Information** , then look for the **Server OS** line.

 ![](https://community.openenergymonitor.org/uploads/default/original/2X/9/91325e78ed4c2c7ac73cd9d398b1f52c58b32804.png)

---

<div class="post-metadata">

**Author:** ![Paul](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/paul/32/28_2.png) [@Paul](https://community.openenergymonitor.org/u/Paul)\
**Post date:** [27 October 2016 18:38 UTC](https://community.openenergymonitor.org/t/dirty-cow-vulnerability/2010/6 "2016-10-27T18:38:35Z")

</div>

> [@Jon](#):
>
> to get the current Linux version for the emonPi image:

Applies to all current versions of emoncms.

Paul

---

<div class="post-metadata">

**Author:** ![Jon](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/jon/32/1876_2.png) [@Jon](https://community.openenergymonitor.org/u/Jon)\
**Post date:** [27 October 2016 18:40 UTC](https://community.openenergymonitor.org/t/dirty-cow-vulnerability/2010/7 "2016-10-27T18:40:52Z")

</div>

> [@Paul](#):
>
> Applies to all current versions of emoncms.

Darn! I wanted to be special because I have an emonPi ;-).

---

<div class="post-metadata">

**Author:** ![Paul](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/paul/32/28_2.png) [@Paul](https://community.openenergymonitor.org/u/Paul)\
**Post date:** [27 October 2016 19:24 UTC](https://community.openenergymonitor.org/t/dirty-cow-vulnerability/2010/8 "2016-10-27T19:24:04Z")

</div>

It seems that self-builds are more special Jon - they get a more recent update… 🤑

![](https://community.openenergymonitor.org/uploads/default/original/2X/d/dc46759a035ddde871b8f232909d7a82fd659389.PNG)

Paul

---

<div class="post-metadata">

**Author:** ![Jon](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/jon/32/1876_2.png) [@Jon](https://community.openenergymonitor.org/u/Jon)\
**Post date:** [27 October 2016 22:00 UTC](https://community.openenergymonitor.org/t/dirty-cow-vulnerability/2010/9 "2016-10-27T22:00:44Z")

</div>

I was watching the dist-upgrade commands scroll by (kinda like watching paint dry) and I saw **rpikernelhack**. From searching The Internet it seems OK and are Linux patches for RaspPi.

Is this really OK? I don’t remember seeing this before.  
&nbsp;

```nohighlight
Adding 'diversion of /boot/overlays/dwc2.dtbo to /usr/share/rpikernelhack/overlays/dwc2.dtbo by rpikernelhack'
Adding 'diversion of /boot/overlays/enc28j60.dtbo to /usr/share/rpikernelhack/overlays/enc28j60.dtbo by rpikernelhack'
Adding 'diversion of /boot/overlays/gpio-ir.dtbo to /usr/share/rpikernelhack/overlays/gpio-ir.dtbo by rpikernelhack'
Adding 'diversion of /boot/overlays/gpio-poweroff.dtbo to /usr/share/rpikernelhack/overlays/gpio-poweroff.dtbo by rpikernelhack'
Adding 'diversion of /boot/overlays/hifiberry-amp.dtbo to /usr/share/rpikernelhack/overlays/hifiberry-amp.dtbo by rpikernelhack'

```

---

<div class="post-metadata">

**Author:** ![glyn.hudson](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/glyn.hudson/32/35003_2.png) [@glyn.hudson](https://community.openenergymonitor.org/u/glyn.hudson)\
**Post date:** [27 October 2016 22:55 UTC](https://community.openenergymonitor.org/t/dirty-cow-vulnerability/2010/10 "2016-10-27T22:55:15Z")

</div>

> <https://raspberrypi.stackexchange.com/questions/51410/what-is-rpikernelhack>

Nothing to worry about

> It’s just the directory name given by the developers who have created a Raspberry Pi specific set of patches to the Linux kernel.

---

<div class="post-metadata">

**Author:** ![Paul\_Cardelli](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/paul_cardelli/32/1501_2.png) [@Paul\_Cardelli](https://community.openenergymonitor.org/u/Paul_Cardelli)\
**Post date:** [29 October 2016 06:01 UTC](https://community.openenergymonitor.org/t/dirty-cow-vulnerability/2010/11 "2016-10-29T06:01:00Z")

</div>

anything special I need to do when updating the kernal with the root on an external USB Hard drive?

Just saying cause I ended up with a rainbow screen. I’ll check a few things out. Maybe the new kernel.img file was corrupt.

---

<div class="post-metadata">

**Author:** ![Bill.Thomson](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/bill.thomson/32/1834_2.png) [@Bill.Thomson](https://community.openenergymonitor.org/u/Bill.Thomson)\
**Post date:** [29 October 2016 11:51 UTC](https://community.openenergymonitor.org/t/dirty-cow-vulnerability/2010/12 "2016-10-29T11:51:22Z")

</div>

What distro / version are you running?

---

<div class="post-metadata">

**Author:** ![Paul\_Cardelli](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/paul_cardelli/32/1501_2.png) [@Paul\_Cardelli](https://community.openenergymonitor.org/u/Paul_Cardelli)\
**Post date:** [29 October 2016 14:09 UTC](https://community.openenergymonitor.org/t/dirty-cow-vulnerability/2010/13 "2016-10-29T14:09:19Z")

</div>

I was running the pre built emonSD-03May16, which I had migrated to my external USB HD, and made read-write able.

I tried changing the cmdline.txt to boot from the SD card, but got the same rainbow screen. Maybe I can reflash my SDcard and start over and recover my 15 days of data on my HDD. I’m going to try and test my PI3 with an image I have on my other PI2 for something else.

---

<div class="post-metadata">

**Author:** ![Bill.Thomson](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/bill.thomson/32/1834_2.png) [@Bill.Thomson](https://community.openenergymonitor.org/u/Bill.Thomson)\
**Post date:** [29 October 2016 16:04 UTC](https://community.openenergymonitor.org/t/dirty-cow-vulnerability/2010/14 "2016-10-29T16:04:20Z")

</div>

> [@Paul\_Cardelli](#):
>
> I’m going to try and test my PI3 with an image I have on my other PI2 for something else.

Run `sudo apt-get update && sudo apt-get upgrade` (provided it’s Raspbian, or a derivative) on the card that you pull from your Pi2. Otherwise, you’ll _definitely_ get the rainbow…

Did you do the apt-get update/upgrade on your HDD? That _should_ have been all that was needed.

---

<div class="post-metadata">

**Author:** ![Paul\_Cardelli](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/paul_cardelli/32/1501_2.png) [@Paul\_Cardelli](https://community.openenergymonitor.org/u/Paul_Cardelli)\
**Post date:** [29 October 2016 16:21 UTC](https://community.openenergymonitor.org/t/dirty-cow-vulnerability/2010/15 "2016-10-29T16:21:25Z")

</div>

can’t get it to boot from the hard drive or SD card at this point

---

<div class="post-metadata">

**Author:** ![Bill.Thomson](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/bill.thomson/32/1834_2.png) [@Bill.Thomson](https://community.openenergymonitor.org/u/Bill.Thomson)\
**Post date:** [29 October 2016 16:23 UTC](https://community.openenergymonitor.org/t/dirty-cow-vulnerability/2010/16 "2016-10-29T16:23:30Z")

</div>

Is the “rainbow” a small square in the upper right corner of your screen?  
Or is it the large one that occupies most of the screen?

---

<div class="post-metadata">

**Author:** ![Paul\_Cardelli](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/paul_cardelli/32/1501_2.png) [@Paul\_Cardelli](https://community.openenergymonitor.org/u/Paul_Cardelli)\
**Post date:** [29 October 2016 17:44 UTC](https://community.openenergymonitor.org/t/dirty-cow-vulnerability/2010/17 "2016-10-29T17:44:17Z")

</div>

not sure what happened. Looks like I did not move the data folder off the SD card, so I’m in the process of getting that to the HD. I did have to build a new SD card, and copy the old cmdline.txt from the old SD card to get it to boot past the rainbow colors. This seems to be working, and the HD booted with everything but my data folder which was still mounting to the SD card.

So once I get stable again I’ll check my version and make sure it was jsut the SD card giving me grief, and likely due to using one of those cheep Samsung 32GB cards I had laying around. I keep forgetting why I hate them. 😉 Probably only good for pictures.
