diff mbox

[Natty,SRU] : fix yama_ptracer_del lockdep warning

Message ID 20110629191704.34466dbc@tom-ThinkPad-T410
State New
Headers show

Commit Message

Ming Lei June 29, 2011, 11:17 a.m. UTC
From 8c09cdfb22a34ca49afaae4494f792aa02cf1580 Mon Sep 17 00:00:00 2001
From: Ming Lei <ming.lei@canonical.com>
Date: Wed, 29 Jun 2011 19:06:25 +0800
Subject: [PATCH][Natty SRU]:fix yama_ptracer_del lockdep warning

yama_ptracer_del can be called in softirq context, also
can be run in common process context, so take spin_lock_bh
in yama_ptracer_del to fix it, othewise deadlock may be
produced.

buglink: http://bugs.launchpad.net/bugs/791019

Signed-off-by: Ming Lei <ming.lei@canonical.com>
---
 security/yama/yama_lsm.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Comments

Bryan Wu June 29, 2011, 11:21 a.m. UTC | #1
On Wed, Jun 29, 2011 at 7:17 PM, Ming Lei <ming.lei@canonical.com> wrote:
> From 8c09cdfb22a34ca49afaae4494f792aa02cf1580 Mon Sep 17 00:00:00 2001
> From: Ming Lei <ming.lei@canonical.com>
> Date: Wed, 29 Jun 2011 19:06:25 +0800
> Subject: [PATCH][Natty SRU]:fix yama_ptracer_del lockdep warning
>
> yama_ptracer_del can be called in softirq context, also
> can be run in common process context, so take spin_lock_bh
> in yama_ptracer_del to fix it, othewise deadlock may be
> produced.
>

Please input SRU Justification

> buglink: http://bugs.launchpad.net/bugs/791019
>

It should be "BugLink"

-Bryan

> Signed-off-by: Ming Lei <ming.lei@canonical.com>
> ---
>  security/yama/yama_lsm.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/security/yama/yama_lsm.c b/security/yama/yama_lsm.c
> index 7c3591a..927e6ad 100644
> --- a/security/yama/yama_lsm.c
> +++ b/security/yama/yama_lsm.c
> @@ -82,7 +82,7 @@ static void yama_ptracer_del(struct task_struct *tracer,
>        struct ptrace_relation *relation;
>        struct list_head *list, *safe;
>
> -       spin_lock(&ptracer_relations_lock);
> +       spin_lock_bh(&ptracer_relations_lock);
>        list_for_each_safe(list, safe, &ptracer_relations) {
>                relation = list_entry(list, struct ptrace_relation, node);
>                if (relation->tracee == tracee ||
> @@ -91,7 +91,7 @@ static void yama_ptracer_del(struct task_struct *tracer,
>                        kfree(relation);
>                }
>        }
> -       spin_unlock(&ptracer_relations_lock);
> +       spin_unlock_bh(&ptracer_relations_lock);
>  }
>
>  /**
> --
> 1.7.4.1
>
>
>
> --
> Ming Lei
>
> --
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
>
Ming Lei June 29, 2011, 11:33 a.m. UTC | #2
On Wed, 29 Jun 2011 19:21:49 +0800
Bryan Wu <bryan.wu@canonical.com> wrote:

> On Wed, Jun 29, 2011 at 7:17 PM, Ming Lei <ming.lei@canonical.com> wrote:
> > From 8c09cdfb22a34ca49afaae4494f792aa02cf1580 Mon Sep 17 00:00:00 2001
> > From: Ming Lei <ming.lei@canonical.com>
> > Date: Wed, 29 Jun 2011 19:06:25 +0800
> > Subject: [PATCH][Natty SRU]:fix yama_ptracer_del lockdep warning
> >
> > yama_ptracer_del can be called in softirq context, also
> > can be run in common process context, so take spin_lock_bh
> > in yama_ptracer_del to fix it, othewise deadlock may be
> > produced.
> >
> 
> Please input SRU Justification
> 
> > buglink: http://bugs.launchpad.net/bugs/791019
> >
> 
> It should be "BugLink"

Will do it, thanks Bryan.


thanks,
--
Ming Lei
diff mbox

Patch

diff --git a/security/yama/yama_lsm.c b/security/yama/yama_lsm.c
index 7c3591a..927e6ad 100644
--- a/security/yama/yama_lsm.c
+++ b/security/yama/yama_lsm.c
@@ -82,7 +82,7 @@  static void yama_ptracer_del(struct task_struct *tracer,
 	struct ptrace_relation *relation;
 	struct list_head *list, *safe;
 
-	spin_lock(&ptracer_relations_lock);
+	spin_lock_bh(&ptracer_relations_lock);
 	list_for_each_safe(list, safe, &ptracer_relations) {
 		relation = list_entry(list, struct ptrace_relation, node);
 		if (relation->tracee == tracee ||
@@ -91,7 +91,7 @@  static void yama_ptracer_del(struct task_struct *tracer,
 			kfree(relation);
 		}
 	}
-	spin_unlock(&ptracer_relations_lock);
+	spin_unlock_bh(&ptracer_relations_lock);
 }
 
 /**