All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/3] ptrace: annotate siglock acquirement
@ 2010-08-22 10:22 Namhyung Kim
  2010-08-23 16:53 ` Roland McGrath
  0 siblings, 1 reply; 2+ messages in thread
From: Namhyung Kim @ 2010-08-22 10:22 UTC (permalink / raw)
  To: Roland McGrath, Oleg Nesterov; +Cc: linux-kernel

lock_task_sighand() conditionally acquires sighand->siglock in case of
returning non-NULL but unlock_task_sighand() releases it unconditionally.
This leads sparse to complain about the lock context imbalance. Annotate it
to make sparse happier.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
---
 kernel/ptrace.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/kernel/ptrace.c b/kernel/ptrace.c
index 1abbb4d..4553275 100644
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -438,6 +438,7 @@ static int ptrace_getsiginfo(struct task_struct *child, siginfo_t *info)
 	int error = -ESRCH;
 
 	if (lock_task_sighand(child, &flags)) {
+		__acquire(&child->sighand->siglock);
 		error = -EINVAL;
 		if (likely(child->last_siginfo != NULL)) {
 			*info = *child->last_siginfo;
@@ -454,6 +455,7 @@ static int ptrace_setsiginfo(struct task_struct *child, const siginfo_t *info)
 	int error = -ESRCH;
 
 	if (lock_task_sighand(child, &flags)) {
+		__acquire(&child->sighand->siglock);
 		error = -EINVAL;
 		if (likely(child->last_siginfo != NULL)) {
 			*child->last_siginfo = *info;
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 3/3] ptrace: annotate siglock acquirement
  2010-08-22 10:22 [PATCH 3/3] ptrace: annotate siglock acquirement Namhyung Kim
@ 2010-08-23 16:53 ` Roland McGrath
  0 siblings, 0 replies; 2+ messages in thread
From: Roland McGrath @ 2010-08-23 16:53 UTC (permalink / raw)
  To: Namhyung Kim; +Cc: Oleg Nesterov, linux-kernel

Acked-by: Roland McGrath <roland@redhat.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-08-23 16:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-22 10:22 [PATCH 3/3] ptrace: annotate siglock acquirement Namhyung Kim
2010-08-23 16:53 ` Roland McGrath

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.