Skip to content

Commit 85b6bce

Browse files
Pavel MachekLinus Torvalds
authored andcommitted
[PATCH] Fix suspend with traced tasks
strace /bin/bash misbehaves after resume; this fixes it. (akpm: it's scary calling refrigerator() in state TASK_TRACED, but it seems to do the right thing). Signed-off-by: Pavel Machek <pavel@suse.cz> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent 1a75a3f commit 85b6bce

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎kernel/power/process.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ static inline int freezeable(struct task_struct * p)
2626
(p->flags & PF_NOFREEZE) ||
2727
(p->exit_state == EXIT_ZOMBIE) ||
2828
(p->exit_state == EXIT_DEAD) ||
29-
(p->state == TASK_STOPPED) ||
30-
(p->state == TASK_TRACED))
29+
(p->state == TASK_STOPPED))
3130
return 0;
3231
return 1;
3332
}

‎kernel/signal.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1560,6 +1560,7 @@ static void ptrace_stop(int exit_code, int nostop_code, siginfo_t *info)
15601560
/* Let the debugger run. */
15611561
set_current_state(TASK_TRACED);
15621562
spin_unlock_irq(&current->sighand->siglock);
1563+
try_to_freeze();
15631564
read_lock(&tasklist_lock);
15641565
if (likely(current->ptrace & PT_PTRACED) &&
15651566
likely(current->parent != current->real_parent ||

0 commit comments

Comments
 (0)