From patchwork Wed Jun 29 13:20:12 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 102603 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 BF827B6F5A for ; Wed, 29 Jun 2011 23:20:33 +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 1Qbugh-0003nq-Kj; Wed, 29 Jun 2011 13:20:15 +0000 Received: from adelie.canonical.com ([91.189.90.139]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1Qbugf-0003nl-Mu for kernel-team@lists.ubuntu.com; Wed, 29 Jun 2011 13:20:13 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by adelie.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1Qbugf-0002WN-E5 for ; Wed, 29 Jun 2011 13:20:13 +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 1Qbugf-0001ai-BE for kernel-team@lists.ubuntu.com; Wed, 29 Jun 2011 13:20:13 +0000 Date: Wed, 29 Jun 2011 21:20:12 +0800 From: Ming Lei To: kernel-team@lists.ubuntu.com Subject: [PATCH] [Natty SRU] UBUNTU: SAUCE: fix yama_ptracer_del lockdep warning Message-ID: <20110629212012.4377f687@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 7e597da6c9b6aea298ac8fdf93951a4d4b259d68 Mon Sep 17 00:00:00 2001 From: Ming Lei Date: Wed, 29 Jun 2011 19:06:25 +0800 Subject: [PATCH] [Natty SRU] 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 --- 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); } /**