Commit e0d3a4ae authored by Denis Kirjanov's avatar Denis Kirjanov Committed by Greg Kroah-Hartman

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

commit 238c1a78 upstream.

Fix potential initial_lfsr buffer overrun.
Writing past the end of the buffer could happen when index == ENTRIES
Signed-off-by: default avatarDenis Kirjanov <dkirjanov@kernel.org>
Signed-off-by: default avatarRobert Richter <robert.richter@amd.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent b8504b8d
......@@ -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];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment