Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1308412 > unrolled thread

Re: [lkp] [ptrace] 63a745aa6a: inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage.

Started bySebastian Andrzej Siewior <bigeasy@linutronix.de>
First post2016-01-13 14:30 +0100
Last post2016-01-13 14:30 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [lkp] [ptrace] 63a745aa6a: inconsistent {HARDIRQ-ON-W} ->  {IN-HARDIRQ-W} usage. Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2016-01-13 14:30 +0100

#1308412 — Re: [lkp] [ptrace] 63a745aa6a: inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage.

FromSebastian Andrzej Siewior <bigeasy@linutronix.de>
Date2016-01-13 14:30 +0100
SubjectRe: [lkp] [ptrace] 63a745aa6a: inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage.
Message-ID<qQtEU-hT-73@gated-at.bofh.it>
Subject: [PATCH RT] ptrace: don't open IRQs in ptrace_freeze_traced() too early

In the non-RT case the spin_lock_irq() here disables interrupts as well
as raw_spin_lock_irq(). So in the unlock case the interrupts are enabled
too early. 

Reported-by: kernel test robot <ying.huang@linux.intel.com>
Cc: stable-rt@vger.kernel.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 kernel/ptrace.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/kernel/ptrace.c b/kernel/ptrace.c
index d1d158005ad0..2856b433d9d6 100644
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -129,12 +129,14 @@ static bool ptrace_freeze_traced(struct task_struct *task)
 
 	spin_lock_irq(&task->sighand->siglock);
 	if (task_is_traced(task) && !__fatal_signal_pending(task)) {
-		raw_spin_lock_irq(&task->pi_lock);
+		unsigned long flags;
+
+		raw_spin_lock_irqsave(&task->pi_lock, flags);
 		if (task->state & __TASK_TRACED)
 			task->state = __TASK_TRACED;
 		else
 			task->saved_state = __TASK_TRACED;
-		raw_spin_unlock_irq(&task->pi_lock);
+		raw_spin_unlock_irqrestore(&task->pi_lock, flags);
 		ret = true;
 	}
 	spin_unlock_irq(&task->sighand->siglock);
-- 
2.7.0.rc3

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web