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

Commit ba55d3db authored by Will Deacon's avatar Will Deacon Committed by Russell King
Browse files

ARM: 6767/1: ptrace: fix register indexing in GETHBPREGS request



The GETHBPREGS ptrace request incorrectly maps its index argument onto
the thread's saved debug state when the index != 0. This has not yet
been seen from userspace because GDB (the only user of this request)
only reads from register 0.

This patch fixes the indexing.

Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 8f311270
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -996,10 +996,10 @@ static int ptrace_gethbpregs(struct task_struct *tsk, long num,
		while (!(arch_ctrl.len & 0x1))
			arch_ctrl.len >>= 1;

		if (idx & 0x1)
			reg = encode_ctrl_reg(arch_ctrl);
		else
		if (num & 0x1)
			reg = bp->attr.bp_addr;
		else
			reg = encode_ctrl_reg(arch_ctrl);
	}

put: