All of lore.kernel.org
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@gmail.com>
To: Roland McGrath <roland@redhat.com>, Oleg Nesterov <oleg@redhat.com>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 3/3] ptrace: annotate siglock acquirement
Date: Sun, 22 Aug 2010 19:22:16 +0900	[thread overview]
Message-ID: <1282472536-7430-3-git-send-email-namhyung@gmail.com> (raw)

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


             reply	other threads:[~2010-08-22 10:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-22 10:22 Namhyung Kim [this message]
2010-08-23 16:53 ` [PATCH 3/3] ptrace: annotate siglock acquirement Roland McGrath

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1282472536-7430-3-git-send-email-namhyung@gmail.com \
    --to=namhyung@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@redhat.com \
    --cc=roland@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.