From patchwork Thu Oct 8 20:45:10 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Johansen X-Patchwork-Id: 35528 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 21D97B7B77 for ; Fri, 9 Oct 2009 07:45:51 +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 1Mvzrm-0000aX-3X; Thu, 08 Oct 2009 21:45:38 +0100 Received: from adelie.canonical.com ([91.189.90.139]) by chlorine.canonical.com with esmtp (Exim 4.60) (envelope-from ) id 1Mvzre-0000X5-IK for kernel-team@lists.ubuntu.com; Thu, 08 Oct 2009 21:45:30 +0100 Received: from hutte.canonical.com ([91.189.90.181]) by adelie.canonical.com with esmtp (Exim 4.69 #1 (Debian)) id 1Mvzrd-0003x8-6k; Thu, 08 Oct 2009 21:45:29 +0100 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 1Mvzrc-00021q-Nx; Thu, 08 Oct 2009 21:45:29 +0100 From: John Johansen To: kernel-team@lists.ubuntu.com Subject: [PATCH 1/2] UBUNTU: SAUCE: AppArmor: Set error code after structure initialization. Date: Thu, 8 Oct 2009 13:45:10 -0700 Message-Id: <1255034711-11623-2-git-send-email-john.johansen@canonical.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1255034711-11623-1-git-send-email-john.johansen@canonical.com> References: <1255034711-11623-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/427948 The net audit structure error field was being set before the audit structure was cleared. Move the assignment to after the audit structure is cleared. Signed-off-by: John Johansen --- ubuntu/apparmor/net.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/ubuntu/apparmor/net.c b/ubuntu/apparmor/net.c index b236d14..20f921b 100644 --- a/ubuntu/apparmor/net.c +++ b/ubuntu/apparmor/net.c @@ -110,9 +110,8 @@ int aa_net_perm(struct aa_profile *profile, char *operation, family_mask = profile->net.allowed[family]; - sa.base.error = (family_mask & (1 << type)) ? 0 : -EACCES; - memset(&sa, 0, sizeof(sa)); + sa.base.error = (family_mask & (1 << type)) ? 0 : -EACCES; sa.base.operation = operation; sa.base.gfp_mask = GFP_KERNEL; sa.family = family;