Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/120011/?format=api
https://patches.dpdk.org/api/patches/120011/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20221121204015.1135573-9-okaya@kernel.org/", "project": { "id": 1, "url": "https://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": "<20221121204015.1135573-9-okaya@kernel.org>", "list_archive_url": "https://inbox.dpdk.org/dev/20221121204015.1135573-9-okaya@kernel.org", "date": "2022-11-21T20:40:14", "name": "[08/11] malloc: check result of rte_mem_virt2memseg", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "88ce6302668a2f99e696d167d16b20f579573cdb", "submitter": { "id": 2903, "url": "https://patches.dpdk.org/api/people/2903/?format=api", "name": "Sinan Kaya", "email": "okaya@kernel.org" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20221121204015.1135573-9-okaya@kernel.org/mbox/", "series": [ { "id": 25842, "url": "https://patches.dpdk.org/api/series/25842/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=25842", "date": "2022-11-21T20:40:06", "name": "codeql fixes for various subsystems", "version": 1, "mbox": "https://patches.dpdk.org/series/25842/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/120011/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/120011/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 57081A056B;\n\tMon, 21 Nov 2022 21:41:08 +0100 (CET)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 1C9D742D58;\n\tMon, 21 Nov 2022 21:40:40 +0100 (CET)", "from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75])\n by mails.dpdk.org (Postfix) with ESMTP id 940F842D3D\n for <dev@dpdk.org>; Mon, 21 Nov 2022 21:40:35 +0100 (CET)", "from smtp.kernel.org (relay.kernel.org [52.25.139.140])\n (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n (No client certificate requested)\n by ams.source.kernel.org (Postfix) with ESMTPS id 64998B815DE\n for <dev@dpdk.org>; Mon, 21 Nov 2022 20:40:35 +0000 (UTC)", "by smtp.kernel.org (Postfix) with ESMTPSA id C998FC433D6;\n Mon, 21 Nov 2022 20:40:34 +0000 (UTC)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n s=k20201202; t=1669063235;\n bh=AuYg0waQuxWd4B5EH2AbZ0Gkal/nrcpO9xrEg70Qxyg=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=JbjhVv9Zg5wG4eJBQWYEtKOi7l7ShW4p5gKmTcHRE3wVeQ+h4c78sDvx1vqfO8U8C\n t7Nw60kJ4NYzDnNEJAzZdPJwI5NOQDtJXFrHvA9bGlBuGq+QfwSsGyd4J/9RkrcWkZ\n 1/GtD2o+DK6zJ8Zdw/AT5GJ3PAUpcWNoDs5CqY+0cHC4Kgh/llycA3duAJH5KNVAw/\n jLlnLDsp6hNuauRI7UmF6gDe0nEtquLTpU5Z7AybVukjLPdmrOFrv/5AoTzEtTSgMv\n It+McVNnxCJqJN/7bHGa1LSfG77D2Ml5onEQybW22aeefXi2iubURLEzTsBgBfZ+gv\n /Et8jm80IuC9Q==", "From": "okaya@kernel.org", "To": "dev@dpdk.org", "Cc": "Sinan Kaya <okaya@kernel.org>", "Subject": "[PATCH 08/11] malloc: check result of rte_mem_virt2memseg", "Date": "Mon, 21 Nov 2022 15:40:14 -0500", "Message-Id": "<20221121204015.1135573-9-okaya@kernel.org>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20221121204015.1135573-1-okaya@kernel.org>", "References": "<20221121204015.1135573-1-okaya@kernel.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "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" }, "content": "From: Sinan Kaya <okaya@kernel.org>\n\nIn malloc_elem_find_max_iova_contig result of call to rte_mem_virt2memseg\nis dereferenced here and may be null.\n\nSigned-off-by: Sinan Kaya <okaya@kernel.org>\n---\n lib/eal/common/malloc_elem.c | 11 ++++++++---\n lib/eal/common/malloc_heap.c | 2 +-\n 2 files changed, 9 insertions(+), 4 deletions(-)", "diff": "diff --git a/lib/eal/common/malloc_elem.c b/lib/eal/common/malloc_elem.c\nindex 83f05497cc..54d7b2f278 100644\n--- a/lib/eal/common/malloc_elem.c\n+++ b/lib/eal/common/malloc_elem.c\n@@ -63,6 +63,8 @@ malloc_elem_find_max_iova_contig(struct malloc_elem *elem, size_t align)\n \n \tcur_page = RTE_PTR_ALIGN_FLOOR(contig_seg_start, page_sz);\n \tms = rte_mem_virt2memseg(cur_page, elem->msl);\n+\tif (!ms)\n+\t\treturn 0;\n \n \t/* do first iteration outside the loop */\n \tpage_end = RTE_PTR_ADD(cur_page, page_sz);\n@@ -91,9 +93,12 @@ malloc_elem_find_max_iova_contig(struct malloc_elem *elem, size_t align)\n \t\t\t * we're not blowing past data end.\n \t\t\t */\n \t\t\tms = rte_mem_virt2memseg(contig_seg_start, elem->msl);\n-\t\t\tcur_page = ms->addr;\n-\t\t\t/* don't trigger another recalculation */\n-\t\t\texpected_iova = ms->iova;\n+\t\t\tif (ms) {\n+\t\t\t\tcur_page = ms->addr;\n+\n+\t\t\t\t/* don't trigger another recalculation */\n+\t\t\t\texpected_iova = ms->iova;\n+\t\t\t}\n \t\t\tcontinue;\n \t\t}\n \t\t/* cur_seg_end ends on a page boundary or on data end. if we're\ndiff --git a/lib/eal/common/malloc_heap.c b/lib/eal/common/malloc_heap.c\nindex 438c0856e2..1bf2e94c83 100644\n--- a/lib/eal/common/malloc_heap.c\n+++ b/lib/eal/common/malloc_heap.c\n@@ -932,7 +932,7 @@ malloc_heap_free(struct malloc_elem *elem)\n \t\tconst struct rte_memseg *tmp =\n \t\t\t\trte_mem_virt2memseg(aligned_start, msl);\n \n-\t\tif (tmp->flags & RTE_MEMSEG_FLAG_DO_NOT_FREE) {\n+\t\tif (tmp && (tmp->flags & RTE_MEMSEG_FLAG_DO_NOT_FREE)) {\n \t\t\t/* this is an unfreeable segment, so move start */\n \t\t\taligned_start = RTE_PTR_ADD(tmp->addr, tmp->len);\n \t\t}\n", "prefixes": [ "08/11" ] }{ "id": 120011, "url": "