Message ID | 20221101201803.372652-14-zohar@linux.ibm.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-integrity-owner@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E7CE1C4167E for <linux-integrity@archiver.kernel.org>; Tue, 1 Nov 2022 20:18:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230190AbiKAUSd (ORCPT <rfc822;linux-integrity@archiver.kernel.org>); Tue, 1 Nov 2022 16:18:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230196AbiKAUSa (ORCPT <rfc822;linux-integrity@vger.kernel.org>); Tue, 1 Nov 2022 16:18:30 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FF1D2648 for <linux-integrity@vger.kernel.org>; Tue, 1 Nov 2022 13:18:30 -0700 (PDT) Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 2A1K3WlU006857; Tue, 1 Nov 2022 20:18:26 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=Ko43l/KpNmwAWiWHHumT6aGjxWyEO39cJCPiU3qoddI=; b=Hv3h2SEHV7dD5nAlpSEr58Ht5PivfKol7emhaethwCBTklW+lQiQ/aXWp++mj0ZTGDpw 9srU9sL7n9OGnWUjXvnsQU1x2qTP4mU7LLHQlTT1ZKykrFq/axmb7Z9HlZ82Bzzt3PnH UdjXfx/KB4LK9P7cxOth5yKyADDORSWsc1EyQADcUO9qQUKdpswrNrTHhokJn1u7nQww 1/pHvQ31nwXSipKJoSsHbwFxRUykqrjosew8JAoK+b90Bjzl/XFhmhjWSGyx9Koaps5e g7vyelMTSeyjGzxJkFzuNNGWRuC9H0rZG+3r2oBX3ljw+ugYjLmKoUyMJv8C4zwmq5o3 bg== Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3kjtw3g4hy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 01 Nov 2022 20:18:25 +0000 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 2A1K6b2O014527; Tue, 1 Nov 2022 20:18:23 GMT Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by ppma04ams.nl.ibm.com with ESMTP id 3kgut9572w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 01 Nov 2022 20:18:23 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 2A1KIK8019595582 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 1 Nov 2022 20:18:20 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 77006A405B; Tue, 1 Nov 2022 20:18:20 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 853D7A4054; Tue, 1 Nov 2022 20:18:19 +0000 (GMT) Received: from li-f45666cc-3089-11b2-a85c-c57d1a57929f.ibm.com.com (unknown [9.160.14.52]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 1 Nov 2022 20:18:19 +0000 (GMT) From: Mimi Zohar <zohar@linux.ibm.com> To: linux-integrity@vger.kernel.org Cc: Mimi Zohar <zohar@linux.ibm.com>, Petr Vorel <pvorel@suse.cz>, Vitaly Chikunov <vt@altlinux.org>, Stefan Berger <stefanb@linux.ibm.com> Subject: [PATCH ima-evm-utils v4 13/17] Missing template data size lower bounds checking Date: Tue, 1 Nov 2022 16:17:59 -0400 Message-Id: <20221101201803.372652-14-zohar@linux.ibm.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20221101201803.372652-1-zohar@linux.ibm.com> References: <20221101201803.372652-1-zohar@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: QC9alV7sGIyNK318ic4loYcq_MHIqZ5i X-Proofpoint-GUID: QC9alV7sGIyNK318ic4loYcq_MHIqZ5i X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-01_10,2022-11-01_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 lowpriorityscore=0 adultscore=0 suspectscore=0 phishscore=0 priorityscore=1501 mlxlogscore=999 clxscore=1015 bulkscore=0 spamscore=0 impostorscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211010143 Precedence: bulk List-ID: <linux-integrity.vger.kernel.org> X-Mailing-List: linux-integrity@vger.kernel.org |
Series |
address deprecated warnings
|
expand
|
diff --git a/src/evmctl.c b/src/evmctl.c index 17cc2188fe73..2fc11db77ec3 100644 --- a/src/evmctl.c +++ b/src/evmctl.c @@ -2183,6 +2183,10 @@ static int ima_measurement(const char *file) log_err("Unable to read template length\n"); goto out; } + if (entry.template_len == 0) { + log_err("Invalid template data len\n"); + goto out; + } } else { entry.template_len = SHA_DIGEST_LENGTH + TCG_EVENT_NAME_LEN_MAX + 1;