[tip:perf/core] powerpc/oprofile: fix potential buffer overrun in op_model_cell.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit-ID:  b12eab1a796a306caef7046b21a76efa35f5f489
Gitweb:     http://git.kernel.org/tip/b12eab1a796a306caef7046b21a76efa35f5f489
Author:     Denis Kirjanov <dkirjanov@xxxxxxxxxxxxxxx>
AuthorDate: Tue, 1 Jun 2010 15:43:34 -0400
Committer:  Robert Richter <robert.richter@xxxxxxx>
CommitDate: Fri, 4 Jun 2010 11:36:08 +0200

powerpc/oprofile: fix potential buffer overrun in op_model_cell.c

Fix potential initial_lfsr buffer overrun.
Writing past the end of the buffer could happen when index == ENTRIES

Signed-off-by: Denis Kirjanov <dkirjanov@xxxxxxxxxx>
Cc: stable@xxxxxxxxxx
Signed-off-by: Robert Richter <robert.richter@xxxxxxx>
---
 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];
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux