GIT: unionfs2-2.6.27.y: powerpc/oprofile: fix potential buffer overrun in op_model_cell.c
Erez Zadok
ezk at fsl.cs.sunysb.edu
Thu Aug 12 23:15:28 EDT 2010
commit 43bee391355ad45021579511963dfb46d6e810fb
Author: Denis Kirjanov <dkirjanov at hera.kernel.org>
Date: Tue Jun 1 15:43:34 2010 -0400
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 at kernel.org>
Signed-off-by: Robert Richter <robert.richter at amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh at suse.de>
diff --git a/arch/powerpc/oprofile/op_model_cell.c b/arch/powerpc/oprofile/op_model_cell.c
index 5ff4de3..303721d 100644
--- a/arch/powerpc/oprofile/op_model_cell.c
+++ b/arch/powerpc/oprofile/op_model_cell.c
@@ -821,7 +821,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];
More information about the unionfs-cvs
mailing list