Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/79735/?format=api
http://patchwork.dpdk.org/api/patches/79735/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20201006074143.31691-2-olivier.matz@6wind.com/", "project": { "id": 1, "url": "http://patchwork.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<20201006074143.31691-2-olivier.matz@6wind.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20201006074143.31691-2-olivier.matz@6wind.com", "date": "2020-10-06T07:41:41", "name": "[1/3] examples/fips_validation: fix buffer overflow", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "170e865cdf910bce05ddb1602dd5f8bf512f9bc7", "submitter": { "id": 8, "url": "http://patchwork.dpdk.org/api/people/8/?format=api", "name": "Olivier Matz", "email": "olivier.matz@6wind.com" }, "delegate": { "id": 6690, "url": "http://patchwork.dpdk.org/api/users/6690/?format=api", "username": "akhil", "first_name": "akhil", "last_name": "goyal", "email": "gakhil@marvell.com" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20201006074143.31691-2-olivier.matz@6wind.com/mbox/", "series": [ { "id": 12711, "url": "http://patchwork.dpdk.org/api/series/12711/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=12711", "date": "2020-10-06T07:41:43", "name": "examples/fips_validation: misc fixes", "version": 1, "mbox": "http://patchwork.dpdk.org/series/12711/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/79735/comments/", "check": "success", "checks": "http://patchwork.dpdk.org/api/patches/79735/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 9D0BAA04BB;\n\tTue, 6 Oct 2020 09:42:23 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 6C7E72C54;\n\tTue, 6 Oct 2020 09:42:05 +0200 (CEST)", "from proxy.6wind.com (host.76.145.23.62.rev.coltfrance.com\n [62.23.145.76]) by dpdk.org (Postfix) with ESMTP id 58DDC11A4;\n Tue, 6 Oct 2020 09:42:01 +0200 (CEST)", "from glumotte.dev.6wind.com. (unknown [10.16.0.195])\n by proxy.6wind.com (Postfix) with ESMTP id 2D58946B234;\n Tue, 6 Oct 2020 09:42:00 +0200 (CEST)" ], "From": "Olivier Matz <olivier.matz@6wind.com>", "To": "dev@dpdk.org", "Cc": "Marko Kovacevic <marko.kovacevic@intel.com>,\n Akhil Goyal <akhil.goyal@nxp.com>, Fan Zhang <roy.fan.zhang@intel.com>,\n Arek Kusztal <arkadiuszx.kusztal@intel.com>, stable@dpdk.org", "Date": "Tue, 6 Oct 2020 09:41:41 +0200", "Message-Id": "<20201006074143.31691-2-olivier.matz@6wind.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20201006074143.31691-1-olivier.matz@6wind.com>", "References": "<20201006074143.31691-1-olivier.matz@6wind.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [PATCH 1/3] examples/fips_validation: fix buffer overflow", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "If the file name is larger than MAX_STRING_SIZE (64), strcpy()\nwill overwrite the content of memory.\n\nReplace strcpy() by rte_strscpy(), check its return value, and\nincrease file_name size to 256.\n\nFixes: 3d0fad56b74a (\"examples/fips_validation: add crypto FIPS application\")\nCc: stable@dpdk.org\n\nSigned-off-by: Olivier Matz <olivier.matz@6wind.com>\n---\n examples/fips_validation/fips_validation.c | 12 ++++++++++--\n examples/fips_validation/fips_validation.h | 3 ++-\n 2 files changed, 12 insertions(+), 3 deletions(-)", "diff": "diff --git a/examples/fips_validation/fips_validation.c b/examples/fips_validation/fips_validation.c\nindex 9bdf257b8b..13f763c9aa 100644\n--- a/examples/fips_validation/fips_validation.c\n+++ b/examples/fips_validation/fips_validation.c\n@@ -281,7 +281,11 @@ fips_test_init(const char *req_file_path, const char *rsp_file_path,\n \n \tfips_test_clear();\n \n-\tstrcpy(info.file_name, req_file_path);\n+\tif (rte_strscpy(info.file_name, req_file_path,\n+\t\t\t\tsizeof(info.file_name)) < 0) {\n+\t\tRTE_LOG(ERR, USER1, \"Path %s too long\\n\", req_file_path);\n+\t\treturn -EINVAL;\n+\t}\n \tinfo.algo = FIPS_TEST_ALGO_MAX;\n \tif (parse_file_type(req_file_path) < 0) {\n \t\tRTE_LOG(ERR, USER1, \"File %s type not supported\\n\",\n@@ -307,7 +311,11 @@ fips_test_init(const char *req_file_path, const char *rsp_file_path,\n \t\treturn -ENOMEM;\n \t}\n \n-\tstrlcpy(info.device_name, device_name, sizeof(info.device_name));\n+\tif (rte_strscpy(info.device_name, device_name,\n+\t\t\t\tsizeof(info.device_name)) < 0) {\n+\t\tRTE_LOG(ERR, USER1, \"Device name %s too long\\n\", device_name);\n+\t\treturn -EINVAL;\n+\t}\n \n \tif (fips_test_parse_header() < 0) {\n \t\tRTE_LOG(ERR, USER1, \"Failed parsing header\\n\");\ndiff --git a/examples/fips_validation/fips_validation.h b/examples/fips_validation/fips_validation.h\nindex 75fa555fa6..deba83eada 100644\n--- a/examples/fips_validation/fips_validation.h\n+++ b/examples/fips_validation/fips_validation.h\n@@ -14,6 +14,7 @@\n #define MAX_NB_TESTS\t\t10240\n #define MAX_BUF_SIZE\t\t2048\n #define MAX_STRING_SIZE\t\t64\n+#define MAX_FILE_NAME_SIZE\t256\n #define MAX_DIGEST_SIZE\t\t64\n \n #define POSITIVE_TEST\t\t0\n@@ -164,7 +165,7 @@ struct fips_test_interim_info {\n \tuint32_t vec_start_off;\n \tuint32_t nb_vec_lines;\n \tchar device_name[MAX_STRING_SIZE];\n-\tchar file_name[MAX_STRING_SIZE];\n+\tchar file_name[MAX_FILE_NAME_SIZE];\n \n \tunion {\n \t\tstruct aesavs_interim_data aes_data;\n", "prefixes": [ "1/3" ] }{ "id": 79735, "url": "