From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 98901A04FA for ; Sun, 2 Feb 2020 16:56:26 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 441C11BFD7; Sun, 2 Feb 2020 16:56:26 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 28E191BFD7 for ; Sun, 2 Feb 2020 16:56:24 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 012Forqj030432; Sun, 2 Feb 2020 07:56:23 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0818; bh=HAWzEpQkUeuWChoXNzs+j/uQTxck4zT2I0o7sVl66bA=; b=Q5JwoTcrYqdGwEaIoZQ8haz3ENPfwPTYa5u/TBTzgeaqlwV3ZWgjQlRjrZBLvguOmtX0 15Xv8hh2wD8CCUkN/ZZowfBdpHfdKcwdkMm5TQv9uxcbeauegiyryX891asKifNF83QO cwNT2zqulBvQEAr94Wi6cdXUsmmuLsUZFTRu5cSA4mcb40ZWjyyPtvnAvR3axKfcETvK OqfpEtxz2Th3/y8wR8/2R3QXC4M/5/PPmFb+hz/Og2IvGw1ct193PC1DccM9kcg30/tp zhivcSktZ6XSUja77lCNfXJ9ISQajEqiU7TDDEy/dXL0MejnaR6Ukn/+7NrOgywezt17 0w== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0b-0016f401.pphosted.com with ESMTP id 2xw9qubj12-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Sun, 02 Feb 2020 07:56:23 -0800 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sun, 2 Feb 2020 07:56:21 -0800 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Sun, 2 Feb 2020 07:56:21 -0800 Received: from vvenus375.il.marvell.com (unknown [10.5.120.75]) by maili.marvell.com (Postfix) with ESMTP id B1D963F703F; Sun, 2 Feb 2020 07:56:19 -0800 (PST) From: To: CC: , , , Date: Sun, 2 Feb 2020 17:57:14 +0200 Message-ID: <20200202155715.17079-1-michaelsh@marvell.com> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572 definitions=2020-02-02_04:2020-01-31, 2020-02-02 signatures=0 Subject: [dpdk-stable] [PATCH] examples/fips: add path length validation X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" From: Michael Shamis Coverity CID 350345: "copy into fixed size buffer: string overflow." Now the length of string is validated before copy. Cc: stable@dpdk.org Signed-off-by: Michael Shamis --- examples/fips_validation/fips_validation.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/fips_validation/fips_validation.c b/examples/fips_validation/fips_validation.c index 07ffa62e9..48a92ee6d 100644 --- a/examples/fips_validation/fips_validation.c +++ b/examples/fips_validation/fips_validation.c @@ -257,6 +257,11 @@ fips_test_init(const char *req_file_path, const char *rsp_file_path, fips_test_clear(); + if (strlen(req_file_path) > MAX_STRING_SIZE) { + RTE_LOG(ERR, USER1, "File name %s is too long\n", + req_file_path); + return -EINVAL; + } strcpy(info.file_name, req_file_path); info.algo = FIPS_TEST_ALGO_MAX; if (parse_file_type(req_file_path) < 0) { -- 2.24.0