From patchwork Mon Nov 9 20:41:56 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Johansen X-Patchwork-Id: 38034 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 159BDB7B96 for ; Tue, 10 Nov 2009 11:49:44 +1100 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.60) (envelope-from ) id 1N7b5e-0002aX-LJ; Mon, 09 Nov 2009 20:43:54 +0000 Received: from adelie.canonical.com ([91.189.90.139]) by chlorine.canonical.com with esmtp (Exim 4.60) (envelope-from ) id 1N7b45-0001pP-Kk for kernel-team@lists.ubuntu.com; Mon, 09 Nov 2009 20:42:17 +0000 Received: from hutte.canonical.com ([91.189.90.181]) by adelie.canonical.com with esmtp (Exim 4.69 #1 (Debian)) id 1N7b45-0004DX-J3; Mon, 09 Nov 2009 20:42:17 +0000 Received: from pool-98-108-130-232.ptldor.fios.verizon.net ([98.108.130.232] helo=canonical.com) by hutte.canonical.com with esmtpsa (TLS-1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.69) (envelope-from ) id 1N7b45-0001ZZ-6V; Mon, 09 Nov 2009 20:42:17 +0000 From: John Johansen To: kernel-team@lists.ubuntu.com Subject: [PATCH 4/4] UBUNTU: SAUCE: AppArmor: Fix refcounting bug causing leak of creds Date: Mon, 9 Nov 2009 12:41:56 -0800 Message-Id: <1257799316-12573-5-git-send-email-john.johansen@canonical.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1257799316-12573-1-git-send-email-john.johansen@canonical.com> References: <1257799316-12573-1-git-send-email-john.johansen@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.8 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com BugLink: http://bugs.launchpad.net/bugs/479115 AppArmor when doing ptrace check for domain changes, fails to drop the ref count on the task creds when it is unconfined. Signed-off-by: John Johansen --- ubuntu/apparmor/domain.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/ubuntu/apparmor/domain.c b/ubuntu/apparmor/domain.c index 0594ea2..95cf5f5 100644 --- a/ubuntu/apparmor/domain.c +++ b/ubuntu/apparmor/domain.c @@ -65,9 +65,10 @@ static int aa_may_change_ptraced_domain(struct task_struct *task, rcu_read_unlock(); if (!tracerp) - return error; + goto out; error = aa_may_ptrace(tracer, tracerp, to_profile, PTRACE_MODE_ATTACH); +out: put_cred(cred); return error;