procps/proc
Jim Warner a45dace4b8 library: utility buffers now immune to buffer overflow
A recent Debian bug report, dealing with release 3.2.8
and its even more restrictive buffer sizes (1024) used
in stat, statm and status reads via file2str calls, is
a reminder of what could yet happen to procps-ng. Size
needs are determined by kernel evolution and/or config
options so that bug could resurface even though buffer
size is currently 4 times the old procps-3.2.8 limits.

Those sizes were raised from 1024 to 4096 bytes in the
patch submitted by Eric Dumazet, and referenced below.

This patch makes libprocps immune to future changes in
the amount of stuff that is ultimately found in a proc
'stat', 'statm' or 'status' subdirectory. We now trade
the former static buffer of 4096 bytes for dynamically
allocated buffers whose size can be increased by need.

Even though this change is solely an internal one, and
in no way directly affects the API or the ABI, libtool
suggests that the LIBprocps_REVISION be raised. I hope
Craig remembers to do that just before a next release.

We don't want a repeat of the procps-ng-3.3.4 boo-boo,
but with no API/ABI impact that probably can't happen.

p.s. A big thanks to Jaromir Capik <jcapik@redhat.com>
who reviewed my original version and, of course, found
some of my trademark illogic + unnecessary code. After
his coaxing, he helped make this a much better commit.

Reference(s):
. procps-3.2.8
http://bugs.debian.org/702965
. allow large list of groups
commit 7933435584

Signed-off-by: Jim Warner <james.warner@comcast.net>
Reviewed by:   Jaromir Capik <jcapik@redhat.com>
2013-03-23 16:00:02 +01:00
..
alloc.c pmap: use correct types for memory allocation 2012-11-06 22:22:11 +11:00
alloc.h pmap: use correct types for memory allocation 2012-11-06 22:22:11 +11:00
COPYING miscellaneous: clean up trailing whitespace throughout 2013-03-14 12:36:47 +01:00
devname.c miscellaneous: clean up trailing whitespace throughout 2013-03-14 12:36:47 +01:00
devname.h Change restrict to __restrict in public includes 2012-01-09 21:44:51 +11:00
escape.c miscellaneous: clean up trailing whitespace throughout 2013-03-14 12:36:47 +01:00
escape.h Change restrict to __restrict in public includes 2012-01-09 21:44:51 +11:00
ksym.c miscellaneous: clean up trailing whitespace throughout 2013-03-14 12:36:47 +01:00
libprocps.pc.in Renaming libprocfs to libprocps 2011-12-23 09:18:43 +11:00
libprocps.sym Expose freeproc for libproc 2013-01-01 13:13:44 +11:00
Makefile.am Expose freeproc for libproc 2013-01-01 13:13:44 +11:00
procps.h Two new options for pmap, -X and -XX 2012-09-27 22:08:04 +10:00
pwcache.c docs: clarification to license headers in files 2012-03-03 18:41:11 +11:00
pwcache.h better handling of long usernames 2004-07-20 23:31:12 +00:00
readproc.c library: utility buffers now immune to buffer overflow 2013-03-23 16:00:02 +01:00
readproc.h library: fix proc_t page fault delta counts alignment 2012-10-02 20:56:39 +10:00
sig.c docs: clarification to license headers in files 2012-03-03 18:41:11 +11:00
sig.h Change restrict to __restrict in public includes 2012-01-09 21:44:51 +11:00
slab.c miscellaneous: clean up trailing whitespace throughout 2013-03-14 12:36:47 +01:00
slab.h Increase slab name from 64 to 128 characters 2012-06-26 22:01:42 +10:00
sysinfo.c miscellaneous: clean up trailing whitespace throughout 2013-03-14 12:36:47 +01:00
sysinfo.h Change restrict to __restrict in public includes 2012-01-09 21:44:51 +11:00
version.c miscellaneous: fixed current misspell-check's findings 2013-03-14 12:36:47 +01:00
version.h name change: procps -> procps-ng 2011-06-04 20:50:12 +02:00
wchan.h Change restrict to __restrict in public includes 2012-01-09 21:44:51 +11:00
whattime.c docs: clarification to license headers in files 2012-03-03 18:41:11 +11:00
whattime.h big header clean-up 2002-12-09 07:00:07 +00:00