From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753000AbdEPM6Z (ORCPT ); Tue, 16 May 2017 08:58:25 -0400 Received: from lhrrgout.huawei.com ([194.213.3.17]:26610 "EHLO lhrrgout.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751219AbdEPM6X (ORCPT ); Tue, 16 May 2017 08:58:23 -0400 From: Roberto Sassu To: CC: , , Roberto Sassu Subject: [PATCH 4/7] ima: declare get_binary_runtime_size() as non-static Date: Tue, 16 May 2017 14:53:44 +0200 Message-ID: <20170516125347.10574-5-roberto.sassu@huawei.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170516125347.10574-1-roberto.sassu@huawei.com> References: <20170516125347.10574-1-roberto.sassu@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.204.66.1] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020202.591AF768.00F4,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 82dc00a906525bf55f8ba21eeae747a9 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The function get_binary_runtime_size(), renamed to ima_get_template_entry_size(), is now declared as non-static, so that it can be used by callers outside ima_queue.c to calculate the size of a given measurement entry. Signed-off-by: Roberto Sassu --- security/integrity/ima/ima.h | 1 + security/integrity/ima/ima_queue.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/security/integrity/ima/ima.h b/security/integrity/ima/ima.h index b563fbd..10ef9c8 100644 --- a/security/integrity/ima/ima.h +++ b/security/integrity/ima/ima.h @@ -131,6 +131,7 @@ extern bool ima_canonical_fmt; /* Internal IMA function definitions */ int ima_init(void); int ima_fs_init(void); +int ima_get_template_entry_size(struct ima_template_entry *entry); int ima_add_template_entry(struct ima_template_entry *entry, int violation, const char *op, struct inode *inode, const unsigned char *filename); diff --git a/security/integrity/ima/ima_queue.c b/security/integrity/ima/ima_queue.c index f628968..24984a2 100644 --- a/security/integrity/ima/ima_queue.c +++ b/security/integrity/ima/ima_queue.c @@ -74,7 +74,7 @@ static struct ima_queue_entry *ima_lookup_digest_entry(u8 *digest_value, * binary_runtime_measurement list entry, which contains a * couple of variable length fields (e.g template name and data). */ -static int get_binary_runtime_size(struct ima_template_entry *entry) +int ima_get_template_entry_size(struct ima_template_entry *entry) { int size = 0; @@ -118,7 +118,7 @@ static int ima_add_digest_entry(struct ima_template_entry *entry, if (binary_runtime_size != ULONG_MAX) { int size; - size = get_binary_runtime_size(entry); + size = ima_get_template_entry_size(entry); binary_runtime_size = (binary_runtime_size < ULONG_MAX - size) ? binary_runtime_size + size : ULONG_MAX; } -- 2.9.3