mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 02:21:52 +09:00
powerpc/oprofile: fix potential buffer overrun in op_model_cell.c
commit 238c1a78c9 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@kernel.org>
Signed-off-by: Robert Richter <robert.richter@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
b8504b8d34
commit
e0d3a4aeaf
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user