Message ID | 20221103183904.103562-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 66F8FC4332F for <linux-integrity@archiver.kernel.org>; Thu, 3 Nov 2022 18:39:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230295AbiKCSjd (ORCPT <rfc822;linux-integrity@archiver.kernel.org>); Thu, 3 Nov 2022 14:39:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230340AbiKCSjb (ORCPT <rfc822;linux-integrity@vger.kernel.org>); Thu, 3 Nov 2022 14:39:31 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63E12BC1D for <linux-integrity@vger.kernel.org>; Thu, 3 Nov 2022 11:39:31 -0700 (PDT) Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 2A3ITSCu039326 for <linux-integrity@vger.kernel.org>; Thu, 3 Nov 2022 18:39:31 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=vHgHfYGhrhSEt983xhDwAtQ7MvtOABjyvXFIU73aVjw=; b=tphcmQ/paifIdWvk3e4gxx2XbIzxWfb156ub+cTNyjffYfsySOVtgIim9yQBQvHs6MQ9 /XPg5XzJwaPIg2Au01xIRqFjtkEb2ZjMxB56XLJ0o1MO8AZCT6j9n3hHkwDGjrBfS1Zo Px7kcAz/c2gNotN2jEEYwEH60dRS2ch0TKPULSo54TebvCAlk29MCNlLN5grX9d9HSa4 4MZdu0oV6j4nipGEPwILDq2NioiLWVaO8XO7STUhjMYD3T8Ypz/ZYYX/pTuNTBIhJHJH ybeqRvgKcrS3mRuCnVhuI2nHcxXanTjVvm7+McLTOpoXMdPAsFucAPZ7AGxUWErEgL4E pA== Received: from ppma04fra.de.ibm.com (6a.4a.5195.ip4.static.sl-reverse.com [149.81.74.106]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3kme16ctpg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for <linux-integrity@vger.kernel.org>; Thu, 03 Nov 2022 18:39:30 +0000 Received: from pps.filterd (ppma04fra.de.ibm.com [127.0.0.1]) by ppma04fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 2A3IZfAE024831 for <linux-integrity@vger.kernel.org>; Thu, 3 Nov 2022 18:39:28 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma04fra.de.ibm.com with ESMTP id 3kgut8xw30-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for <linux-integrity@vger.kernel.org>; Thu, 03 Nov 2022 18:39:28 +0000 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 2A3Ie2n347841746 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for <linux-integrity@vger.kernel.org>; Thu, 3 Nov 2022 18:40:02 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E77B142041; Thu, 3 Nov 2022 18:39:25 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D0F114203F; Thu, 3 Nov 2022 18:39:24 +0000 (GMT) Received: from li-f45666cc-3089-11b2-a85c-c57d1a57929f.ibm.com.com (unknown [9.160.20.100]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 3 Nov 2022 18:39:24 +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 v5 13/17] Missing template data size lower bounds checking Date: Thu, 3 Nov 2022 14:39:00 -0400 Message-Id: <20221103183904.103562-14-zohar@linux.ibm.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20221103183904.103562-1-zohar@linux.ibm.com> References: <20221103183904.103562-1-zohar@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: hSZm1A8WEVRLzMCPJlMJo5Q8wQFhx3-C X-Proofpoint-ORIG-GUID: hSZm1A8WEVRLzMCPJlMJo5Q8wQFhx3-C 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-03_04,2022-11-03_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 suspectscore=0 mlxscore=0 phishscore=0 lowpriorityscore=0 mlxlogscore=999 bulkscore=0 clxscore=1015 adultscore=0 priorityscore=1501 impostorscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211030125 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 17472bf621f6..65e27e1681e7 100644 --- a/src/evmctl.c +++ b/src/evmctl.c @@ -2188,6 +2188,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;