proc: do proper range check on readdir offset
commitd86dbfba5a2d6fe17b5fde93b41c03c864d10aa8
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 18 Apr 2011 17:36:54 +0000 (18 10:36 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 22 Apr 2011 15:44:26 +0000 (22 08:44 -0700)
tree01bce18c386c95e43a7ad5909db3ea11227bc2e6
parent67e022f3add1879292986e779b2aaf6ecb93fa58
proc: do proper range check on readdir offset

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>
fs/proc/base.c