Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp974521ybv; Fri, 7 Feb 2020 11:56:02 -0800 (PST) X-Google-Smtp-Source: APXvYqxc25PfI6pEOMMLsvdhg4LCbZK98H9aPCUP+i3iUz5HApqMxkELTsU/hucOOVzJrFLgQ/KR X-Received: by 2002:aca:2b04:: with SMTP id i4mr3215666oik.21.1581105362603; Fri, 07 Feb 2020 11:56:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581105362; cv=none; d=google.com; s=arc-20160816; b=q2gcBydpuK9p9P/iRhy+J75CYrQuysZAwahbDVxUzn0TNPqt0u8w16X1rhjghWZiBK LiVU2t/43WgZFOYqaYVPcntbYs00XfflbjCIl4LTs5gWEIT91g07gY+uyxylPpITzGF3 54oAd8DhA3j4PpJ7/1wnlTUC8s+YUVf77TetgxKKbjE8mRs37CkBI3JgN2k/xTuZB/GN SiibcgZW+ZVFmj36RLeqxGe9QqvdPbBlNyRK/VsYPfGeAG5a2cPidXLID9FR/0qpMdmJ emm5bnynzVIcBpGOWyUX/GMetQ4DZrK0Wf5r8W3ivRuigmyMRGQbTGJLZV78R1GAXcPk swPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=Wab1wguScTHzyucAMlQCj1mKaKzqP1xmnn185QvjsKg=; b=SJrCH3G1CXMbzZUwV7drdPTedEDUPyAkIo4u6VbUpbQLxA7Q7qWoTsV6hohtG5fTtR NlMyGoVgQrUoVAcY32S2v+BHXfMBx7SrS1Zc7ShhJW6jUbHb5K0p0T2cl2SZYghwDoLv zO159lshKqpO/sAUPFezUYRD1iAQE3kwukD3Z6M4GJ6iHKWIB6YZB+SUvnipWFXtprYo oDitKQl4MRdj1N92t9043MUAAXtcov2JmgKj364cN/tKZNBQSdJtLJSOb8bGbPSYCU4B O/inTUKUqgYrbXbz0D4ag2L7tY3woNyZYt8WGKxYWdRyoyx9Y1cxxkZjSg090M7MIM3E 22gA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b="ZLirIX/+"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x23si4155773oie.50.2020.02.07.11.55.50; Fri, 07 Feb 2020 11:56:02 -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; dkim=pass header.i=@linux.microsoft.com header.s=default header.b="ZLirIX/+"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727457AbgBGTx6 (ORCPT + 99 others); Fri, 7 Feb 2020 14:53:58 -0500 Received: from linux.microsoft.com ([13.77.154.182]:34366 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726974AbgBGTx5 (ORCPT ); Fri, 7 Feb 2020 14:53:57 -0500 Received: from tusharsu-Ubuntu.corp.microsoft.com (unknown [131.107.147.225]) by linux.microsoft.com (Postfix) with ESMTPSA id 2658620B9C2F; Fri, 7 Feb 2020 11:53:57 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 2658620B9C2F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1581105237; bh=Wab1wguScTHzyucAMlQCj1mKaKzqP1xmnn185QvjsKg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZLirIX/+w1TwBojZeVAPRJrlBrd9uVHI3mOygG8PkXqz9Mwc6MVyjXMZRtjWLbFqY tBcUxhyMnGrZaRWKqbN6BACT0NAGhV58vBJdPZ0xUYZp002svVWlTqvDZqr8EiblGE wYTiDg4G6HG4KUbsXkKb6KXBDuRuo6brhDJgCNkg= From: Tushar Sugandhi To: zohar@linux.ibm.com, linux-integrity@vger.kernel.org Cc: sashal@kernel.org, nramas@linux.microsoft.com, linux-kernel@vger.kernel.org Subject: [PATCH] IMA: Add log statements for failure conditions. Date: Fri, 7 Feb 2020 11:53:46 -0800 Message-Id: <20200207195346.4017-2-tusharsu@linux.microsoft.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200207195346.4017-1-tusharsu@linux.microsoft.com> References: <20200207195346.4017-1-tusharsu@linux.microsoft.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org process_buffer_measurement() and ima_alloc_key_entry() functions do not have log messages for failure conditions. This change adds log statements in the above functions. Signed-off-by: Tushar Sugandhi Reviewed-by: Lakshmi Ramasubramanian --- security/integrity/ima/ima_main.c | 4 ++++ security/integrity/ima/ima_queue_keys.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/security/integrity/ima/ima_main.c b/security/integrity/ima/ima_main.c index 9fe949c6a530..afab796fb765 100644 --- a/security/integrity/ima/ima_main.c +++ b/security/integrity/ima/ima_main.c @@ -757,6 +757,10 @@ void process_buffer_measurement(const void *buf, int size, ima_free_template_entry(entry); out: + if (ret < 0) + pr_err("Process buffer measurement failed, result: %d\n", + ret); + return; } diff --git a/security/integrity/ima/ima_queue_keys.c b/security/integrity/ima/ima_queue_keys.c index c87c72299191..2cc52f17ea81 100644 --- a/security/integrity/ima/ima_queue_keys.c +++ b/security/integrity/ima/ima_queue_keys.c @@ -90,6 +90,8 @@ static struct ima_key_entry *ima_alloc_key_entry(struct key *keyring, out: if (rc) { + pr_err("Key entry allocation failed, result: %d\n", + rc); ima_free_key_entry(entry); entry = NULL; } -- 2.17.1