mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-18 10:56:14 +00:00
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: Will Deacon <will.deacon@arm.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
parent
8f3112707f
commit
ba55d3db9b
@ -996,10 +996,10 @@ static int ptrace_gethbpregs(struct task_struct *tsk, long num,
|
|||||||
while (!(arch_ctrl.len & 0x1))
|
while (!(arch_ctrl.len & 0x1))
|
||||||
arch_ctrl.len >>= 1;
|
arch_ctrl.len >>= 1;
|
||||||
|
|
||||||
if (idx & 0x1)
|
if (num & 0x1)
|
||||||
reg = encode_ctrl_reg(arch_ctrl);
|
|
||||||
else
|
|
||||||
reg = bp->attr.bp_addr;
|
reg = bp->attr.bp_addr;
|
||||||
|
else
|
||||||
|
reg = encode_ctrl_reg(arch_ctrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
put:
|
put:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user