diff -Nru procps-3.3.3/debian/changelog procps-3.3.3/debian/changelog --- procps-3.3.3/debian/changelog 2013-10-17 03:33:19.000000000 +0000 +++ procps-3.3.3/debian/changelog 2013-10-28 17:36:11.000000000 +0000 @@ -1,3 +1,13 @@ +procps (1:3.3.3-2ubuntu9) saucy; urgency=low + + * Avoid SEGV if file2str should read zero bytes. This is a backport of + 526bc5df from upstream. When utility buffers were introduced for file2str + read requests, a subtle change was inadvertently introduced such that a + read of zero no longer returns a -1 value. This returns to the behavior to + returning -1 on zero byte reads. (LP: #1242746) + + -- Dave Chiluk Mon, 28 Oct 2013 10:36:11 -0700 + procps (1:3.3.3-2ubuntu8) saucy; urgency=low * ignore_eaccess.patch: If we get eaccess when opening a sysctl file for diff -Nru procps-3.3.3/debian/patches/series procps-3.3.3/debian/patches/series --- procps-3.3.3/debian/patches/series 2013-10-17 03:33:19.000000000 +0000 +++ procps-3.3.3/debian/patches/series 2013-10-28 17:36:09.000000000 +0000 @@ -6,3 +6,4 @@ lp1213160-pwdx-locale-fail dynamic_file2str.patch ignore_eaccess.patch +zeroreadsegv.patch diff -Nru procps-3.3.3/debian/patches/zeroreadsegv.patch procps-3.3.3/debian/patches/zeroreadsegv.patch --- procps-3.3.3/debian/patches/zeroreadsegv.patch 1970-01-01 00:00:00.000000000 +0000 +++ procps-3.3.3/debian/patches/zeroreadsegv.patch 2013-10-28 17:36:09.000000000 +0000 @@ -0,0 +1,23 @@ +Description: avoid SEGV if file2str should read zero bytes + avoid SEGV if file2str should read zero bytes. This is a backport of 526bc5df + from upstream. When utility buffers were introduced for file2str read + requests, a subtle change was inadvertently introduced such that a read of + zero no longer returns a -1 value. This returns to the behavior to returning + -1 on zero byte reads. + +Author: Dave Chiluk +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1242746 +Origin: upstream https://www.gitorious.org/procps/procps/commit/526bc5dfa924177e68be0123bd67e3370955f924 + +Index: procps-3.3.3/proc/readproc.c +=================================================================== +--- procps-3.3.3.orig/proc/readproc.c 2013-10-28 10:19:21.000000000 -0500 ++++ procps-3.3.3/proc/readproc.c 2013-10-28 10:22:51.571809077 -0500 +@@ -548,6 +548,7 @@ + }; + ub->buf[tot_read] = '\0'; + close(fd); ++ if (unlikely(tot_read < 1)) return -1; + return tot_read; + #undef buffGRW + }