summaryrefslogtreecommitdiffstats
path: root/kernel/cpu.c
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2014-01-23 15:55:40 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-23 16:37:01 -0800
commit9f6e963f06c19a57a876cb77a9c87f6a56295b13 (patch)
treeed59763257b26d1faa606f582ccbfbec4a3cfafa /kernel/cpu.c
parentd855a4b79f49ea07d1827fc0591490a6a324148b (diff)
downloadop-kernel-dev-9f6e963f06c19a57a876cb77a9c87f6a56295b13.zip
op-kernel-dev-9f6e963f06c19a57a876cb77a9c87f6a56295b13.tar.gz
proc: fix ->f_pos overflows in first_tid()
1. proc_task_readdir()->first_tid() path truncates f_pos to int, this is wrong even on 64bit. We could check that f_pos < PID_MAX or even INT_MAX in proc_task_readdir(), but this patch simply checks the potential overflow in first_tid(), this check is nop on 64bit. We do not care if it was negative and the new unsigned value is huge, all we need to ensure is that we never wrongly return !NULL. 2. Remove the 2nd "nr != 0" check before get_nr_threads(), nr_threads == 0 is not distinguishable from !pid_task() above. Signed-off-by: Oleg Nesterov <oleg@redhat.com> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: Michal Hocko <mhocko@suse.cz> Cc: Sameer Nanda <snanda@chromium.org> Cc: Sergey Dyasly <dserrg@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/cpu.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud