RAMOOPS: Don't overflow over non-allocated regions
authorAhmed S. Darwish <darwish.07@gmail.com>
Sat, 25 Dec 2010 09:57:09 +0000 (11:57 +0200)
committerAK <andi@firstfloor.org>
Sun, 6 Feb 2011 19:03:48 +0000 (11:03 -0800)
commitbf4a80cbf1ec11260c1a458586f2433431646994
treec7fe9b0c36986d7d02a4bb648fdb6f39dede31e4
parent39ab95f709fd14c0542ad9e5eaebebc30c681094
RAMOOPS: Don't overflow over non-allocated regions

commit 1873bb8115e678ad9fd0aac9dbbc68383bc36e06 upstream.

The current code mis-calculates the ramoops header size, leading to an
overflow over the next record at best, or over a non-allocated region at
worst.  Fix that calculation.

Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
Acked-by: Marco Stornelli <marco.stornelli@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
drivers/char/ramoops.c