diff options
author | Denis Kirjanov <dkirjanov@hera.kernel.org> | 2010-06-01 15:43:34 -0400 |
---|---|---|
committer | Robert Richter <robert.richter@amd.com> | 2010-06-04 11:36:08 +0200 |
commit | b12eab1a796a306caef7046b21a76efa35f5f489 (patch) | |
tree | b7db6304d7db41491c60345311a89be528247dd8 | |
parent | d8a382d2662822248a97ce9d670b90e68aefbd3a (diff) | |
download | linux-b12eab1a796a306caef7046b21a76efa35f5f489.tar.bz2 |
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@kernel.org>
Cc: stable@kernel.org
Signed-off-by: Robert Richter <robert.richter@amd.com>
-rw-r--r-- | 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 2c9e52267292..7fd90d02d8c6 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]; |