summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Kirjanov <dkirjanov@hera.kernel.org>2010-06-01 15:43:34 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-07-05 11:15:48 -0700
commit58e1a2bbd35a5bc67da56b4da8fab4346e75a3d0 (patch)
tree20f28b8b99861d9b8c4b080c01a3d0bacbea90d6
parent657b225f2554228b8344c6ec7219f700228733d1 (diff)
downloadkernel-crypto-58e1a2bbd35a5bc67da56b4da8fab4346e75a3d0.tar.gz
kernel-crypto-58e1a2bbd35a5bc67da56b4da8fab4346e75a3d0.tar.xz
kernel-crypto-58e1a2bbd35a5bc67da56b4da8fab4346e75a3d0.zip
powerpc/oprofile: fix potential buffer overrun in op_model_cell.c
commit 238c1a78c957f3dc7cb848b161dcf4805793ed56 upstream. Fix potential initial_lfsr buffer overrun. Writing past the end of the buffer could happen when index == ENTRIES Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org> Signed-off-by: Robert Richter <robert.richter@amd.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--arch/powerpc/oprofile/op_model_cell.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/oprofile/op_model_cell.c b/arch/powerpc/oprofile/op_model_cell.c
index 2c9e5226729..7fd90d02d8c 100644
--- a/arch/powerpc/oprofile/op_model_cell.c
+++ b/arch/powerpc/oprofile/op_model_cell.c
@@ -1077,7 +1077,7 @@ static int calculate_lfsr(int n)
index = ENTRIES-1;
/* make sure index is valid */
- if ((index > ENTRIES) || (index < 0))
+ if ((index >= ENTRIES) || (index < 0))
index = ENTRIES-1;
return initial_lfsr[index];