From patchwork Mon Jan 22 14:53:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mimi Zohar X-Patchwork-Id: 10178693 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AAFFB600F5 for ; Mon, 22 Jan 2018 14:54:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9E49320453 for ; Mon, 22 Jan 2018 14:54:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 918A127C05; Mon, 22 Jan 2018 14:54:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2E91720453 for ; Mon, 22 Jan 2018 14:54:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751214AbeAVOyq (ORCPT ); Mon, 22 Jan 2018 09:54:46 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:34168 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751087AbeAVOyW (ORCPT ); Mon, 22 Jan 2018 09:54:22 -0500 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w0MEnlG2082920 for ; Mon, 22 Jan 2018 09:54:21 -0500 Received: from e06smtp15.uk.ibm.com (e06smtp15.uk.ibm.com [195.75.94.111]) by mx0b-001b2d01.pphosted.com with ESMTP id 2fnh3yu4sa-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 22 Jan 2018 09:54:21 -0500 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 22 Jan 2018 14:54:19 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 22 Jan 2018 14:54:16 -0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w0MEsGlq65798272; Mon, 22 Jan 2018 14:54:16 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C3CBC52043; Mon, 22 Jan 2018 13:46:40 +0000 (GMT) Received: from localhost.ibm.com (unknown [9.80.102.7]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 14DB95203F; Mon, 22 Jan 2018 13:46:39 +0000 (GMT) From: Mimi Zohar To: linux-integrity@vger.kernel.org Cc: Dmitry Kasatkin , Roberto Sassu , "Bruno E . O . Meneguele" , Mimi Zohar Subject: [PATCH 01/10] ima-evm-utils: fix "ima_measurement" template fields length Date: Mon, 22 Jan 2018 09:53:56 -0500 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516632845-7087-1-git-send-email-zohar@linux.vnet.ibm.com> References: <1516632845-7087-1-git-send-email-zohar@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18012214-0020-0000-0000-000003ED69C9 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18012214-0021-0000-0000-0000427FB20A Message-Id: <1516632845-7087-2-git-send-email-zohar@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-01-22_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1801220211 Sender: linux-integrity-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-integrity@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The template data field length is uint32_t, not uint8_t. Signed-off-by: Mimi Zohar --- src/evmctl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/evmctl.c b/src/evmctl.c index 313a0c5..a6c6e01 100644 --- a/src/evmctl.c +++ b/src/evmctl.c @@ -1342,7 +1342,7 @@ void ima_ng_show(struct template_entry *entry) char *algo, *path; /* get binary digest */ - field_len = *(uint8_t *)fieldp; + field_len = *(uint32_t *)fieldp; fieldp += sizeof(field_len); total_len -= sizeof(field_len); @@ -1356,7 +1356,7 @@ void ima_ng_show(struct template_entry *entry) total_len -= field_len; /* get path */ - field_len = *(uint8_t *)fieldp; + field_len = *(uint32_t *)fieldp; fieldp += sizeof(field_len); total_len -= sizeof(field_len); @@ -1368,7 +1368,7 @@ void ima_ng_show(struct template_entry *entry) if (!strcmp(entry->name, "ima-sig")) { /* get signature */ - field_len = *(uint8_t *)fieldp; + field_len = *(uint32_t *)fieldp; fieldp += sizeof(field_len); total_len -= sizeof(field_len);