aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-12-20 16:50:08 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-12-20 16:50:08 -0500
commita81ce79bf294bf61fd3069abdb0923598615da84 (patch)
treeb3137fbeda278343747bfc0b0ed4259ec9106079 /arch
parentdf36ac1bc2a166eef90785d584e4cfed6f52bd32 (diff)
parentcdc27c27843248ae7eb0df5fc261dd004eaa5670 (diff)
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
Diffstat (limited to 'arch')
-rw-r--r--arch/arm64/kernel/ptrace.c38
1 files changed, 18 insertions, 20 deletions
diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c
index 6777a2192b83..6a8928bba03c 100644
--- a/arch/arm64/kernel/ptrace.c
+++ b/arch/arm64/kernel/ptrace.c
@@ -214,31 +214,29 @@ static int ptrace_hbp_fill_attr_ctrl(unsigned int note_type,
214{ 214{
215 int err, len, type, disabled = !ctrl.enabled; 215 int err, len, type, disabled = !ctrl.enabled;
216 216
217 if (disabled) { 217 attr->disabled = disabled;
218 len = 0; 218 if (disabled)
219 type = HW_BREAKPOINT_EMPTY; 219 return 0;
220 } else { 220
221 err = arch_bp_generic_fields(ctrl, &len, &type); 221 err = arch_bp_generic_fields(ctrl, &len, &type);
222 if (err) 222 if (err)
223 return err; 223 return err;
224 224
225 switch (note_type) { 225 switch (note_type) {
226 case NT_ARM_HW_BREAK: 226 case NT_ARM_HW_BREAK:
227 if ((type & HW_BREAKPOINT_X) != type) 227 if ((type & HW_BREAKPOINT_X) != type)
228 return -EINVAL;
229 break;
230 case NT_ARM_HW_WATCH:
231 if ((type & HW_BREAKPOINT_RW) != type)
232 return -EINVAL;
233 break;
234 default:
235 return -EINVAL; 228 return -EINVAL;
236 } 229 break;
230 case NT_ARM_HW_WATCH:
231 if ((type & HW_BREAKPOINT_RW) != type)
232 return -EINVAL;
233 break;
234 default:
235 return -EINVAL;
237 } 236 }
238 237
239 attr->bp_len = len; 238 attr->bp_len = len;
240 attr->bp_type = type; 239 attr->bp_type = type;
241 attr->disabled = disabled;
242 240
243 return 0; 241 return 0;
244} 242}