From patchwork Mon Nov 9 20:41:54 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Johansen X-Patchwork-Id: 38035 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 82BFCB7B77 for ; Tue, 10 Nov 2009 11:49:45 +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 1N7b5d-0002Zy-L0; Mon, 09 Nov 2009 20:43:53 +0000 Received: from adelie.canonical.com ([91.189.90.139]) by chlorine.canonical.com with esmtp (Exim 4.60) (envelope-from ) id 1N7b3y-0001lv-Hz for kernel-team@lists.ubuntu.com; Mon, 09 Nov 2009 20:42:10 +0000 Received: from hutte.canonical.com ([91.189.90.181]) by adelie.canonical.com with esmtp (Exim 4.69 #1 (Debian)) id 1N7b3y-00048Y-F8; Mon, 09 Nov 2009 20:42:10 +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 1N7b3y-0001ZT-1e; Mon, 09 Nov 2009 20:42:10 +0000 From: John Johansen To: kernel-team@lists.ubuntu.com Subject: [PATCH 2/4] UBUNTU: SAUCE: Fix Oops when in apparmor_bprm_set_creds Date: Mon, 9 Nov 2009 12:41:54 -0800 Message-Id: <1257799316-12573-3-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/446164 If name resolution fails due on exec and a profile is not defined then AppArmor will cause an oops due to a broken conditional leading to dereferencing a profile pointer that is null. Signed-off-by: John Johansen --- ubuntu/apparmor/domain.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/ubuntu/apparmor/domain.c b/ubuntu/apparmor/domain.c index aa25be2..0594ea2 100644 --- a/ubuntu/apparmor/domain.c +++ b/ubuntu/apparmor/domain.c @@ -248,7 +248,7 @@ int apparmor_bprm_set_creds(struct linux_binprm *bprm) sa.base.error = aa_get_name(&bprm->file->f_path, 0, &buffer, (char **) &sa.name); if (sa.base.error) { - if (profile || profile->flags & PFLAG_IX_ON_NAME_ERROR) + if (profile && profile->flags & PFLAG_IX_ON_NAME_ERROR) sa.base.error = 0; sa.base.info = "Exec failed name resolution"; sa.name = bprm->filename;