|
@@ -652,11 +652,10 @@ static unsigned long ptrace_get_debugreg(struct task_struct *tsk, int n)
|
|
|
{
|
|
{
|
|
|
struct thread_struct *thread = &tsk->thread;
|
|
struct thread_struct *thread = &tsk->thread;
|
|
|
unsigned long val = 0;
|
|
unsigned long val = 0;
|
|
|
- int index = n;
|
|
|
|
|
|
|
|
|
|
if (n < HBP_NUM) {
|
|
if (n < HBP_NUM) {
|
|
|
|
|
+ int index = array_index_nospec(n, HBP_NUM);
|
|
|
struct perf_event *bp = thread->ptrace_bps[index];
|
|
struct perf_event *bp = thread->ptrace_bps[index];
|
|
|
- index = array_index_nospec(index, HBP_NUM);
|
|
|
|
|
|
|
|
|
|
if (bp)
|
|
if (bp)
|
|
|
val = bp->hw.info.address;
|
|
val = bp->hw.info.address;
|