提交 238c1a78 编写于 作者: D Denis Kirjanov 提交者: Robert Richter

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: NDenis Kirjanov <dkirjanov@kernel.org>
Cc: stable@kernel.org
Signed-off-by: NRobert Richter <robert.richter@amd.com>
上级 58cc1a9e
...@@ -1077,7 +1077,7 @@ static int calculate_lfsr(int n) ...@@ -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];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册