Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp128593ybv; Wed, 5 Feb 2020 02:37:07 -0800 (PST) X-Google-Smtp-Source: APXvYqzYYEul4efkoT2RLwb+G18cA3+G5QHDgFPKeNoycC1c1bYQSPdKJyK1KBNrGVOgoap4vmLj X-Received: by 2002:aca:5258:: with SMTP id g85mr2476859oib.80.1580899026926; Wed, 05 Feb 2020 02:37:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580899026; cv=none; d=google.com; s=arc-20160816; b=JymSiCxEG6rboV06nN9oWKZEBpPDAUvYWXng65zgY7LEKD52g/7a6X01b1PcPNjU40 5aUJH0wFrjcNKH1B1YVf1v4WAY+jf+j3fD5L5JnrfG3fG3Od/FncUPnmGdmmNf8mrkbM 6i2QaJUh42TiqvIVF89Yz6jlGwUI8w0Lf9y9GCPeHpZaPuepos753kbE2pWgaEH+ApwU gB8x/musA5Yj+HA6J52wPqXSjySHx+Rp7VCyxKfzsxEMqciMg8YpIqa+9fxD6zEY5Qjn pnNSCCsOVQ4dKdXc9XeqyPeJxVhev/QBQ2EQu3Xp277+HJt5nGpYB37HHnn5PXFxYWoB DyMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=Oql554E0Sx1GKM81HDqAkXzJcSM0xVZHBEuCzUNDk60=; b=qLezhdzgwV6rRiq7DbxBvz5sgdWIPF5+Hp6TveMC3x6FGZ+DyacukjQ0iCDtPm6Iwv I4y/xsyG2m2IeHrPKf24hA6eTmUW7Ob8hGSVAJhyUI3lal7hvNY4OPgqhwb2Z5HvqlAU BjdygT9zqXUQJk5l6aWagZQD7vblscQWug+rrnBBxgVvTqas5p+hhCD6LFKgARVfZ9+I YVHBMLxQrE/YtgEPAQm9/TuycxWvuDDbUgOA3Xkx4meusn5XxTSfw5QIiobm7wFUo1f0 Xup74VkQGqDEsvb8pTVotSK5t4GtaJ5MXU+0Cu0oXUTkaxaXmX2hCmicjrqvNxXkq+Q3 /8PQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z14si12444018oth.15.2020.02.05.02.36.49; Wed, 05 Feb 2020 02:37:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728306AbgBEKfP (ORCPT + 99 others); Wed, 5 Feb 2020 05:35:15 -0500 Received: from lhrrgout.huawei.com ([185.176.76.210]:2368 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728034AbgBEKfP (ORCPT ); Wed, 5 Feb 2020 05:35:15 -0500 Received: from lhreml702-cah.china.huawei.com (unknown [172.18.7.106]) by Forcepoint Email with ESMTP id 4D8FBB6410E05FE3D3EE; Wed, 5 Feb 2020 10:35:14 +0000 (GMT) Received: from roberto-HP-EliteDesk-800-G2-DM-65W.huawei.com (10.204.65.160) by smtpsuk.huawei.com (10.201.108.43) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 5 Feb 2020 10:35:07 +0000 From: Roberto Sassu To: , , CC: , , , , Roberto Sassu Subject: [PATCH v2 3/8] ima: Evaluate error in init_ima() Date: Wed, 5 Feb 2020 11:33:12 +0100 Message-ID: <20200205103317.29356-4-roberto.sassu@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200205103317.29356-1-roberto.sassu@huawei.com> References: <20200205103317.29356-1-roberto.sassu@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.204.65.160] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Evaluate error in init_ima() before register_blocking_lsm_notifier() and return if not zero. Fixes: b16942455193 ("ima: use the lsm policy update notifier") Signed-off-by: Roberto Sassu --- security/integrity/ima/ima_main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/security/integrity/ima/ima_main.c b/security/integrity/ima/ima_main.c index d7e987baf127..a16c148ed90d 100644 --- a/security/integrity/ima/ima_main.c +++ b/security/integrity/ima/ima_main.c @@ -738,6 +738,9 @@ static int __init init_ima(void) error = ima_init(); } + if (error) + return error; + error = register_blocking_lsm_notifier(&ima_lsm_policy_notifier); if (error) pr_warn("Couldn't register LSM notifier, error %d\n", error); -- 2.17.1