]> git.baikalelectronics.ru Git - kernel.git/commit
x86/ptrace: make genregs[32]_get/set more robust
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 17 Dec 2009 15:04:56 +0000 (07:04 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 17 Dec 2009 15:04:56 +0000 (07:04 -0800)
commite35fdd84a326f67714825f0f193a93fb818bf562
treec997e71d095d521f945daacc5b1e6b0e767639dc
parent08cb42e1e49eaba72097892d41bbd4b5a6daaf71
x86/ptrace: make genregs[32]_get/set more robust

The loop condition is fragile: we compare an unsigned value to zero, and
then decrement it by something larger than one in the loop.  All the
callers should be passing in appropriately aligned buffer lengths, but
it's better to just not rely on it, and have some appropriate defensive
loop limits.

Acked-by: Roland McGrath <roland@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/x86/kernel/ptrace.c