From patchwork Wed Jun 29 11:17:04 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 102564 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 42FB7B6F68 for ; Wed, 29 Jun 2011 21:17:17 +1000 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1QbslX-0000Id-No; Wed, 29 Jun 2011 11:17:07 +0000 Received: from adelie.canonical.com ([91.189.90.139]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1QbslV-0000Fz-ML for kernel-team@lists.ubuntu.com; Wed, 29 Jun 2011 11:17:05 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by adelie.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1QbslV-0006yA-Ix for ; Wed, 29 Jun 2011 11:17:05 +0000 Received: from [83.141.95.158] (helo=tom-ThinkPad-T410) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1QbslV-0003d2-GZ for kernel-team@lists.ubuntu.com; Wed, 29 Jun 2011 11:17:05 +0000 Date: Wed, 29 Jun 2011 19:17:04 +0800 From: Ming Lei To: kernel-team@lists.ubuntu.com Subject: [PATCH][Natty SRU]: fix yama_ptracer_del lockdep warning Message-ID: <20110629191704.34466dbc@tom-ThinkPad-T410> Organization: ubuntu X-Mailer: Claws Mail 3.7.8 (GTK+ 2.24.4; x86_64-pc-linux-gnu) Mime-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com From 8c09cdfb22a34ca49afaae4494f792aa02cf1580 Mon Sep 17 00:00:00 2001 From: Ming Lei 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 --- 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); } /**