Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Ubuntu Kernel Team (http://www.linux-archive.org/ubuntu-kernel-team/)
-   -   UBUNTU: SAUCE: fix yama_ptracer_del lockdep warning (http://www.linux-archive.org/ubuntu-kernel-team/546027-ubuntu-sauce-fix-yama_ptracer_del-lockdep-warning.html)

Ming Lei 06-29-2011 11:06 AM

UBUNTU: SAUCE: 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.

SRU Justification:

Impact:
- lockdep warning is triggered if lockdep config options are
enabled
- probably deadlock can be produced in yama_ptracer_del path

Fix:
- After applying the patch, lockdep warning is fixefd

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(-)

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


All times are GMT. The time now is 12:19 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.