Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b12eab1a authored by Denis Kirjanov's avatar Denis Kirjanov Committed by Robert Richter
Browse files

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: default avatarDenis Kirjanov <dkirjanov@kernel.org>
Cc: stable@kernel.org
Signed-off-by: default avatarRobert Richter <robert.richter@amd.com>
parent d8a382d2
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -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];