proc: do proper range check on readdir offset
commita506a5b9282e4b944ed314d2b30ce387c44ff9fe
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 18 Apr 2011 17:36:54 +0000 (18 10:36 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 21 Apr 2011 21:32:53 +0000 (21 14:32 -0700)
tree3f132b8344f0fbefb1739d4e049fd166426702e3
parentc8b265db1e63fdb296ec2721f5c1473c44bc4dc5
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