diff -Nru procps-3.3.3/debian/changelog procps-3.3.3/debian/changelog --- procps-3.3.3/debian/changelog 2013-10-16 23:48:39.000000000 -0500 +++ procps-3.3.3/debian/changelog 2013-10-28 10:31:42.000000000 -0500 @@ -1,3 +1,13 @@ +procps (1:3.3.3-2ubuntu5.3) raring; 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:30:50 -0500 + procps (1:3.3.3-2ubuntu5.2) raring; 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-16 23:48:20.000000000 -0500 +++ procps-3.3.3/debian/patches/series 2013-10-28 10:30:28.000000000 -0500 @@ -4,3 +4,4 @@ uptime_test 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 1969-12-31 18:00:00.000000000 -0600 +++ procps-3.3.3/debian/patches/zeroreadsegv.patch 2013-10-28 10:30:28.000000000 -0500 @@ -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 + }