Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 30263
b: refs/heads/master
c: aceecc0
h: refs/heads/master
i:
  30261: c2624bd
  30259: 3d34459
  30255: 0d8b704
v: v3
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Jun 26, 2006
1 parent 0ab2c0e commit e179547
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2ceb8693ef63ae3d154ce1a05d275f2bb20a5e4c
refs/heads/master: aceecc041217b35df753d1ed6e25bd17c0c558d8
36 changes: 26 additions & 10 deletions trunk/fs/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1368,6 +1368,22 @@ static void format_corename(char *corename, const char *pattern, long signr)
*out_ptr = 0;
}

static void zap_process(struct task_struct *start, int *ptraced)
{
struct task_struct *t;

t = start;
do {
if (t != current && t->mm) {
t->mm->core_waiters++;
force_sig_specific(SIGKILL, t);
if (unlikely(t->ptrace) &&
unlikely(t->parent->mm == t->mm))
*ptraced = 1;
}
} while ((t = next_thread(t)) != start);
}

static void zap_threads (struct mm_struct *mm)
{
struct task_struct *g, *p;
Expand All @@ -1385,16 +1401,16 @@ static void zap_threads (struct mm_struct *mm)
}

read_lock(&tasklist_lock);
do_each_thread(g,p)
if (mm == p->mm && p != tsk) {
force_sig_specific(SIGKILL, p);
mm->core_waiters++;
if (unlikely(p->ptrace) &&
unlikely(p->parent->mm == mm))
traced = 1;
}
while_each_thread(g,p);

for_each_process(g) {
p = g;
do {
if (p->mm) {
if (p->mm == mm)
zap_process(p, &traced);
break;
}
} while ((p = next_thread(p)) != g);
}
read_unlock(&tasklist_lock);

if (unlikely(traced)) {
Expand Down

0 comments on commit e179547

Please sign in to comment.