[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1316776650.5262.26.camel@mfleming-mobl1.ger.corp.intel.com>
Date: Fri, 23 Sep 2011 12:17:30 +0100
From: Matt Fleming <matt@...sole-pimps.org>
To: Tejun Heo <tj@...nel.org>
Cc: oleg@...hat.com, vda.linux@...glemail.com,
jan.kratochvil@...hat.com, linux-kernel@...r.kernel.org,
torvalds@...ux-foundation.org, akpm@...ux-foundation.org,
indan@....nu, bdonlan@...il.com, pedro@...esourcery.com
Subject: Re: [PATCH 5/5] ptrace: implement PTRACE_LISTEN
On Tue, 2011-06-14 at 11:20 +0200, Tejun Heo wrote:
[...]
> + case PTRACE_LISTEN:
> + /*
> + * Listen for events. Tracee must be in STOP. It's not
> + * resumed per-se but is not considered to be in TRACED by
> + * wait(2) or ptrace(2). If an async event (e.g. group
> + * stop state change) happens, tracee will enter STOP trap
> + * again. Alternatively, ptracer can issue INTERRUPT to
> + * finish listening and re-trap tracee into STOP.
> + */
> + if (unlikely(!seized || !lock_task_sighand(child, &flags)))
> + break;
> +
> + si = child->last_siginfo;
> + if (unlikely(!si || si->si_code >> 8 != PTRACE_EVENT_STOP))
> + break;
I've only just noticed this. You really don't want to break out of the
switch while holding sighand->siglock. This should read,
if (unlikely(!si || si->si_code >> 8 != PTRACE_EVENT_STOP)) {
unlock_task_sighand(child, &flags);
break;
}
--
Matt Fleming, Intel Open Source Technology Center
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists