proc: do proper range check on readdir offset
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 18 Apr 2011 17:36:54 +0000 (10:36 -0700)
committerBrad Figg <brad.figg@canonical.com>
Wed, 27 Apr 2011 18:42:23 +0000 (11:42 -0700)
commit4c2b87025811b7d35e2c751936ecd5c942088030
tree70673f7cee546f4d2fbf3067035c655e1e546ac1
parentbc5579eebf803ed406e7054d016178c8e71e2089
proc: do proper range check on readdir offset

BugLink: http://bugs.launchpad.net/bugs/769042

commit d8bdc59f215e62098bc5b4256fd9928bf27053a1 upstream.

Rather than pass in some random truncated offset to the pid-related
functions, check that the offset is in range up-front.

This is just cleanup, the previous commit fixed the real problem.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Leann Ogasawara <leann.ogasawara@canonical.com>
fs/proc/base.c