Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Pull arm64 ptrace fix from Catalin Marinas. * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: ptrace: avoid using HW_BREAKPOINT_EMPTY for disabled events
This commit is contained in:
@@ -214,31 +214,29 @@ static int ptrace_hbp_fill_attr_ctrl(unsigned int note_type,
|
|||||||
{
|
{
|
||||||
int err, len, type, disabled = !ctrl.enabled;
|
int err, len, type, disabled = !ctrl.enabled;
|
||||||
|
|
||||||
if (disabled) {
|
attr->disabled = disabled;
|
||||||
len = 0;
|
if (disabled)
|
||||||
type = HW_BREAKPOINT_EMPTY;
|
return 0;
|
||||||
} else {
|
|
||||||
err = arch_bp_generic_fields(ctrl, &len, &type);
|
|
||||||
if (err)
|
|
||||||
return err;
|
|
||||||
|
|
||||||
switch (note_type) {
|
err = arch_bp_generic_fields(ctrl, &len, &type);
|
||||||
case NT_ARM_HW_BREAK:
|
if (err)
|
||||||
if ((type & HW_BREAKPOINT_X) != type)
|
return err;
|
||||||
return -EINVAL;
|
|
||||||
break;
|
switch (note_type) {
|
||||||
case NT_ARM_HW_WATCH:
|
case NT_ARM_HW_BREAK:
|
||||||
if ((type & HW_BREAKPOINT_RW) != type)
|
if ((type & HW_BREAKPOINT_X) != type)
|
||||||
return -EINVAL;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
break;
|
||||||
|
case NT_ARM_HW_WATCH:
|
||||||
|
if ((type & HW_BREAKPOINT_RW) != type)
|
||||||
|
return -EINVAL;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
attr->bp_len = len;
|
attr->bp_len = len;
|
||||||
attr->bp_type = type;
|
attr->bp_type = type;
|
||||||
attr->disabled = disabled;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user