Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754383AbdFSSp2 (ORCPT + 2 others); Mon, 19 Jun 2017 14:45:28 -0400 Received: from wtarreau.pck.nerim.net ([62.212.114.60]:52755 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754275AbdFSSjs (ORCPT ); Mon, 19 Jun 2017 14:39:48 -0400 From: Willy Tarreau To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, linux@roeck-us.net Cc: John Johansen , Willy Tarreau Subject: [PATCH 3.10 118/268] apparmor: don't check for vmalloc_addr if kvzalloc() failed Date: Mon, 19 Jun 2017 20:30:17 +0200 Message-Id: <1497897167-14556-119-git-send-email-w@1wt.eu> X-Mailer: git-send-email 2.8.0.rc2.1.gbe9624a In-Reply-To: <1497897167-14556-1-git-send-email-w@1wt.eu> References: <1497897167-14556-1-git-send-email-w@1wt.eu> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: From: John Johansen commit 3197f5adf539a3ee6331f433a51483f8c842f890 upstream. Signed-off-by: John Johansen Signed-off-by: Willy Tarreau --- security/apparmor/match.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/security/apparmor/match.c b/security/apparmor/match.c index 630f325..10d824b 100644 --- a/security/apparmor/match.c +++ b/security/apparmor/match.c @@ -73,14 +73,14 @@ static struct table_header *unpack_table(char *blob, size_t bsize) u32, be32_to_cpu); else goto fail; + /* if table was vmalloced make sure the page tables are synced + * before it is used, as it goes live to all cpus. + */ + if (is_vmalloc_addr(table)) + vm_unmap_aliases(); } out: - /* if table was vmalloced make sure the page tables are synced - * before it is used, as it goes live to all cpus. - */ - if (is_vmalloc_addr(table)) - vm_unmap_aliases(); return table; fail: kvfree(table); -- 2.8.0.rc2.1.gbe9624a