From patchwork Fri Mar 31 13:25:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Johansen X-Patchwork-Id: 745649 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 3vvj252qvhz9ryr; Sat, 1 Apr 2017 00:26:21 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1ctwZG-0003sR-0i; Fri, 31 Mar 2017 13:26:18 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1ctwZ4-0003i6-Pq for kernel-team@lists.ubuntu.com; Fri, 31 Mar 2017 13:26:06 +0000 Received: from static-50-53-32-2.bvtn.or.frontiernet.net ([50.53.32.2] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1ctwZ4-0007fW-77 for kernel-team@lists.ubuntu.com; Fri, 31 Mar 2017 13:26:06 +0000 From: John Johansen To: kernel-team@lists.ubuntu.com Subject: [PATCH 11/11] UBUNTU: SAUCE: apparmor: fix link auditing failure due to, uninitialized var Date: Fri, 31 Mar 2017 06:25:36 -0700 Message-Id: <20170331132536.18217-12-john.johansen@canonical.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170331132536.18217-1-john.johansen@canonical.com> References: <20170331132536.18217-1-john.johansen@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com The lperms struct is uninitialized for use with auditing if there is an early failure due to a path name error. This can result in incorrect logging or in the extreme case apparmor killing the task with a signal which results in the failure in the referenced bug. BugLink: http://bugs.launchpad.net/bugs/1664912 Signed-off-by: John Johansen Acked-by: Stefan Bader Acked-by: Tim Gardner Signed-off-by: Thadeu Lima de Souza Cascardo --- security/apparmor/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/apparmor/file.c b/security/apparmor/file.c index 95bb2eb..69eed1c 100644 --- a/security/apparmor/file.c +++ b/security/apparmor/file.c @@ -374,7 +374,7 @@ static int profile_path_link(struct aa_profile *profile, struct path_cond *cond) { const char *lname, *tname = NULL; - struct aa_perms lperms, perms; + struct aa_perms lperms = {}, perms; const char *info = NULL; u32 request = AA_MAY_LINK; unsigned int state;