Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/92130/?format=api
http://patches.dpdk.org/api/patches/92130/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1619355594-15223-1-git-send-email-humin29@huawei.com/", "project": { "id": 1, "url": "http://patches.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": "<1619355594-15223-1-git-send-email-humin29@huawei.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1619355594-15223-1-git-send-email-humin29@huawei.com", "date": "2021-04-25T12:59:54", "name": "lib/librte_power: fix using variables before validity check", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "9471e2869beab6154c1991ad6f0b4b2560fd3db3", "submitter": { "id": 1944, "url": "http://patches.dpdk.org/api/people/1944/?format=api", "name": "humin (Q)", "email": "humin29@huawei.com" }, "delegate": { "id": 1, "url": "http://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1619355594-15223-1-git-send-email-humin29@huawei.com/mbox/", "series": [ { "id": 16657, "url": "http://patches.dpdk.org/api/series/16657/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=16657", "date": "2021-04-25T12:59:54", "name": "lib/librte_power: fix using variables before validity check", "version": 1, "mbox": "http://patches.dpdk.org/series/16657/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/92130/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/92130/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 mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 5448EA0548;\n\tSun, 25 Apr 2021 14:59:51 +0200 (CEST)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 3485841139;\n\tSun, 25 Apr 2021 14:59:51 +0200 (CEST)", "from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191])\n by mails.dpdk.org (Postfix) with ESMTP id 5A6564110A\n for <dev@dpdk.org>; Sun, 25 Apr 2021 14:59:49 +0200 (CEST)", "from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.58])\n by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FSp2m6WvLzvSTS\n for <dev@dpdk.org>; Sun, 25 Apr 2021 20:57:20 +0800 (CST)", "from localhost.localdomain (10.69.192.56) by\n DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id\n 14.3.498.0; Sun, 25 Apr 2021 20:59:42 +0800" ], "From": "\"Min Hu (Connor)\" <humin29@huawei.com>", "To": "<dev@dpdk.org>", "CC": "<ferruh.yigit@intel.com>, <david.hunt@intel.com>", "Date": "Sun, 25 Apr 2021 20:59:54 +0800", "Message-ID": "<1619355594-15223-1-git-send-email-humin29@huawei.com>", "X-Mailer": "git-send-email 2.7.4", "MIME-Version": "1.0", "Content-Type": "text/plain", "X-Originating-IP": "[10.69.192.56]", "X-CFilter-Loop": "Reflected", "Subject": "[dpdk-dev] [PATCH] lib/librte_power: fix using variables before\n validity check", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "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": "From: HongBo Zheng <zhenghongbo3@huawei.com>\n\nIn function power_guest_channel_read_msg, 'lcore_id' is used before\nvalidity check, which may cause buffer 'global_fds' accessed by index\n'lcore_id' overflow.\n\nThis patch moves the validity check of 'lcore_id' before the 'lcore_id'\nbeing used for the first time.\n\nFixes: 9dc843eb273b (\"power: extend guest channel API for reading\")\nCc: stable@dpdk.org\n\nSigned-off-by: HongBo Zheng <zhenghongbo3@huawei.com>\nSigned-off-by: Min Hu (Connor) <humin29@huawei.com>\n---\n lib/power/guest_channel.c | 12 ++++++------\n 1 file changed, 6 insertions(+), 6 deletions(-)", "diff": "diff --git a/lib/power/guest_channel.c b/lib/power/guest_channel.c\nindex 2f7507a..d3de3f1 100644\n--- a/lib/power/guest_channel.c\n+++ b/lib/power/guest_channel.c\n@@ -166,6 +166,12 @@ int power_guest_channel_read_msg(void *pkt,\n \tif (pkt_len == 0 || pkt == NULL)\n \t\treturn -1;\n \n+\tif (lcore_id >= RTE_MAX_LCORE) {\n+\t\tRTE_LOG(ERR, GUEST_CHANNEL, \"Channel(%u) is out of range 0...%d\\n\",\n+\t\t\t\tlcore_id, RTE_MAX_LCORE-1);\n+\t\treturn -1;\n+\t}\n+\n \tfds.fd = global_fds[lcore_id];\n \tfds.events = POLLIN;\n \n@@ -179,12 +185,6 @@ int power_guest_channel_read_msg(void *pkt,\n \t\treturn -1;\n \t}\n \n-\tif (lcore_id >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, GUEST_CHANNEL, \"Channel(%u) is out of range 0...%d\\n\",\n-\t\t\t\tlcore_id, RTE_MAX_LCORE-1);\n-\t\treturn -1;\n-\t}\n-\n \tif (global_fds[lcore_id] < 0) {\n \t\tRTE_LOG(ERR, GUEST_CHANNEL, \"Channel is not connected\\n\");\n \t\treturn -1;\n", "prefixes": [] }{ "id": 92130, "url": "