Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4421373ybv; Mon, 10 Feb 2020 19:13:56 -0800 (PST) X-Google-Smtp-Source: APXvYqyuAxbCdIS4cS8Q89vPzs3aHGNtKPh7bX+nZfbtHCfzf7w2kOjYYkBzQ/9aneLKJ7K6/dNf X-Received: by 2002:a05:6830:1185:: with SMTP id u5mr3327597otq.147.1581390836142; Mon, 10 Feb 2020 19:13:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581390836; cv=none; d=google.com; s=arc-20160816; b=XkSeztVMcWXnlnxNrqoM4foEt+BJKNfSTQ5T4hAvd/Ud15L6em+WWtpTmqf01+X9gB H3+RSzRHB1BvWWw/T/lajM9t0QXuNDR+mZHtFrEBXLx02+uHjI6u5F3yAOzq0dTzZ2f5 6X52WRBJuPBBCeeheuF8SKN/+H572lCSNo8S5WunOQSYBnRz27FD74RI7y2j2pzzPkC8 BdhBUqA/rMoMlsGMiNt/r5IK6nrUrVzMubt23xC996Kah3vnWnSQvYRe73Uib0efJ+e8 D3vfUMKNQ5iSb18Aa4K7wJbdgfsRK3qcGmFpbmfwOJaQyjF1/vp4KDikXwP9UeN7EnBc /Hcw== 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=ta2+cPR+SWW5mggrKQmNME5B7299QZqk4q419Roxmxc=; b=F49+qeiwSgtW/KIKE75JA8ZoGOWrx4BnphGttL9XPbArZJAjNysLrXJrB/FuAfKXrH B8C2xgwHOt19xISdue2KOwH8FQNJmuLI3rLfogo0lNLUFkm/Thx1NZp3ooSGI/Do16Xj /UyY99SqfMEDGzbrCrK0ymOgLU5M/XEMgy5JmQqo4TMsJoeHz/HelDE40dlYlrSC8hrB utRDzciY+yEBh6wkpeAmlcpe7wQDk725jYW7gDgATrs5eSSkKoDOvvVTZx4u71vnJLKb n1aPZFvI4zM3c/4gV4om1OAY7MbUGes+53lrVm6BuezqfydDUeSGdNtv9E2fSmjEjEn4 ZXtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=OVMZvnwj; 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 x84si1179670oia.27.2020.02.10.19.13.18; Mon, 10 Feb 2020 19:13:56 -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=OVMZvnwj; 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 S1727716AbgBKCsI (ORCPT + 99 others); Mon, 10 Feb 2020 21:48:08 -0500 Received: from linux.microsoft.com ([13.77.154.182]:49814 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727530AbgBKCsH (ORCPT ); Mon, 10 Feb 2020 21:48:07 -0500 Received: from tusharsu-Ubuntu.corp.microsoft.com (unknown [131.107.147.225]) by linux.microsoft.com (Postfix) with ESMTPSA id 1F6BD20B9C02; Mon, 10 Feb 2020 18:48:07 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 1F6BD20B9C02 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1581389287; bh=ta2+cPR+SWW5mggrKQmNME5B7299QZqk4q419Roxmxc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OVMZvnwjzElk5Wr6POy145pylvqcbHDDrhGk62NDUF/22/eNnpDwjzHEt4KbjQiTM wECK9nh8RM4cDy7WIO7MtHw+0uKUjp8Y9eBYn17GH3Wi9Elo1pbeKn+ZIa+8yPp+1L 8VKdWwIfqX7xq+sQAyZdONGMDqQfvqZ8fkhl9LyU= From: Tushar Sugandhi To: zohar@linux.ibm.com, joe@perches.com, skhan@linuxfoundation.org, linux-integrity@vger.kernel.org Cc: sashal@kernel.org, nramas@linux.microsoft.com, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/3] IMA: Add log statements for failure conditions. Date: Mon, 10 Feb 2020 18:47:54 -0800 Message-Id: <20200211024755.5579-2-tusharsu@linux.microsoft.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200211024755.5579-1-tusharsu@linux.microsoft.com> References: <20200211024755.5579-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 | 3 +++ security/integrity/ima/ima_queue_keys.c | 1 + 2 files changed, 4 insertions(+) diff --git a/security/integrity/ima/ima_main.c b/security/integrity/ima/ima_main.c index 9fe949c6a530..ee01ee34eec8 100644 --- a/security/integrity/ima/ima_main.c +++ b/security/integrity/ima/ima_main.c @@ -757,6 +757,9 @@ 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..6a9ee52649c4 100644 --- a/security/integrity/ima/ima_queue_keys.c +++ b/security/integrity/ima/ima_queue_keys.c @@ -90,6 +90,7 @@ 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