mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-07 11:28:32 +00:00
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>
This commit is contained in:
parent
58cc1a9e3b
commit
238c1a78c9
1 changed files with 1 additions and 1 deletions
|
@ -1077,7 +1077,7 @@ static int calculate_lfsr(int n)
|
||||||
index = ENTRIES-1;
|
index = ENTRIES-1;
|
||||||
|
|
||||||
/* make sure index is valid */
|
/* make sure index is valid */
|
||||||
if ((index > ENTRIES) || (index < 0))
|
if ((index >= ENTRIES) || (index < 0))
|
||||||
index = ENTRIES-1;
|
index = ENTRIES-1;
|
||||||
|
|
||||||
return initial_lfsr[index];
|
return initial_lfsr[index];
|
||||||
|
|
Loading…
Reference in a new issue