All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc/oprofile: fix potential buffer overrun in op_model_cell.c
@ 2010-06-01 19:43 Denis Kirjanov
  2010-06-02 20:12 ` Carl Love
  2010-06-04  9:58 ` Robert Richter
  0 siblings, 2 replies; 3+ messages in thread
From: Denis Kirjanov @ 2010-06-01 19:43 UTC (permalink / raw)
  To: arnd, benh, paulus, jkosina
  Cc: robert.richter, linuxppc-dev, oprofile-list, cel

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>
---
 arch/powerpc/oprofile/op_model_cell.c |    2 +-
 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 2c9e522..7fd90d0 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];

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-06-04 10:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-01 19:43 [PATCH] powerpc/oprofile: fix potential buffer overrun in op_model_cell.c Denis Kirjanov
2010-06-02 20:12 ` Carl Love
2010-06-04  9:58 ` Robert Richter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.