get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/131359/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 131359,
    "url": "https://patches.dpdk.org/api/patches/131359/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20230912090415.48709-1-changfengnan@bytedance.com/",
    "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": "<20230912090415.48709-1-changfengnan@bytedance.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230912090415.48709-1-changfengnan@bytedance.com",
    "date": "2023-09-12T09:04:15",
    "name": "eal: fix modify data area after memset",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "a7b4792e1db1f94f5c94105e75090d3c5ec7fe0e",
    "submitter": {
        "id": 2894,
        "url": "https://patches.dpdk.org/api/people/2894/?format=api",
        "name": "Fengnan Chang",
        "email": "changfengnan@bytedance.com"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20230912090415.48709-1-changfengnan@bytedance.com/mbox/",
    "series": [
        {
            "id": 29485,
            "url": "https://patches.dpdk.org/api/series/29485/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=29485",
            "date": "2023-09-12T09:04:15",
            "name": "eal: fix modify data area after memset",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/29485/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/131359/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/131359/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 687E44257B;\n\tTue, 12 Sep 2023 11:05:40 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id EC377402AC;\n\tTue, 12 Sep 2023 11:05:39 +0200 (CEST)",
            "from mail-pj1-f50.google.com (mail-pj1-f50.google.com\n [209.85.216.50]) by mails.dpdk.org (Postfix) with ESMTP id 86F6940293\n for <dev@dpdk.org>; Tue, 12 Sep 2023 11:05:38 +0200 (CEST)",
            "by mail-pj1-f50.google.com with SMTP id\n 98e67ed59e1d1-273c6658712so1057334a91.0\n for <dev@dpdk.org>; Tue, 12 Sep 2023 02:05:38 -0700 (PDT)",
            "from HTW5T2C6VL.bytedance.net ([203.208.167.146])\n by smtp.gmail.com with ESMTPSA id\n rm10-20020a17090b3eca00b00265c742a262sm6883232pjb.4.2023.09.12.02.05.35\n (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256);\n Tue, 12 Sep 2023 02:05:37 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=bytedance.com; s=google; t=1694509537; x=1695114337; darn=dpdk.org;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:from:to:cc:subject:date:message-id:reply-to;\n bh=OQcZiUC3K5CRCZJ1cvv1DiC4EL6UotjNVpRQdz5uft4=;\n b=ScCy/Dli6e+ynAlvzV2fmNrdfxEgV8vviIux1zvFjaeSpBrWU9jLhsrM4RgJ0jg90K\n cdHsPYAITGx3OWWspv4bvSPIlnKHkYcQTih9GTfEfTKVs+H016X19l9nNHBHd2wBrhSW\n QXr5s/xtZq94ZgYcIYqrp9hEiEoiYtq/eHYTuWkA20SpEWBYlGYUhAyFwcHokj0GDpgW\n b8Kycts+D+7IsDCipQKJ2f6XFXnuJludh3sdymXZsNZL2puWRQD89cnKsQZZPUPne+7h\n Tlzfi1sNZNCzXaqSofMzhJxOYkVQ+vjiMyZ4/nml95qMtgktOWNM+UowUG92rMwFFK2V\n iTIw==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1694509537; x=1695114337;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:x-gm-message-state:from:to:cc:subject:date:message-id\n :reply-to;\n bh=OQcZiUC3K5CRCZJ1cvv1DiC4EL6UotjNVpRQdz5uft4=;\n b=RUvoBkSNMvQAPJrug3/AkymcSbX7iZqviJeEGVr81Ycfa2wMQcx/6XLPnmfcR6Jnzj\n XXd/lrupJWGAjsTa6iUihQ1IUk/xCoyfIRxX1mF10fTCsn4OViGxoBqwCKubJQS/w+H9\n /bQLCvXK5qiu5va5aDc57PIM0pSVYtoL1OLKwwHegwd//eT7PMbBherj1EjrSEdpH5ur\n eAP4f7s3djRIf0K3sg8VklCcaTfkO1dgpMsB9v/3GC7x4WT8ikLDSL+8XOsGQpleZLKp\n rWw8gthZJD9HRkYClpLwop7cvsfpHqhYvTVLbUatDIPulEQsD4wTwG9XjjLbubqEHxR/\n 5/rw==",
        "X-Gm-Message-State": "AOJu0YwPCiSh0cYbTO3Vy3Y7mpVBcGE2uIFCIlUcI3F/a4ZRjuhOOWZv\n FuGLdd7kxuBLpHVxRb/6jMHAUQ==",
        "X-Google-Smtp-Source": "\n AGHT+IEzsrMI9KBLAnCT3QHJjQ/MK8VkN72VgPjbKjeO/mtNlhtDLpNTVoB1gAnfcfuCCk2xvTx2uw==",
        "X-Received": "by 2002:a17:90a:207:b0:26d:40ec:3cf3 with SMTP id\n c7-20020a17090a020700b0026d40ec3cf3mr11067343pjc.0.1694509537601;\n Tue, 12 Sep 2023 02:05:37 -0700 (PDT)",
        "From": "Fengnan Chang <changfengnan@bytedance.com>",
        "To": "anatoly.burakov@intel.com,\n\tdev@dpdk.org,\n\txuemingl@mellanox.com",
        "Cc": "Fengnan Chang <changfengnan@bytedance.com>",
        "Subject": "[PATCH] eal: fix modify data area after memset",
        "Date": "Tue, 12 Sep 2023 17:04:15 +0800",
        "Message-Id": "<20230912090415.48709-1-changfengnan@bytedance.com>",
        "X-Mailer": "git-send-email 2.37.1 (Apple Git-137.1)",
        "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": "Let's look at this path:\nmalloc_elem_free\n   ->malloc_elem_join_adjacent_free\n      ->join_elem(elem, elem->next)\n\n0. cur elem's pad > 0\n1. data area memset in malloc_elem_free first.\n2. next elem is free, try to join cur elem and next.\n3. in join_elem, try to modify inner->size, this address had\nmemset in step 1, it casue the content of addrees become non-zero.\n\nIf user call rte_zmalloc, and pick this elem, it can't get all\nzero'd memory.\n\nFixes: 2808a12cc053 (malloc: fix memory element size in case of padding)\nSigned-off-by: Fengnan Chang <changfengnan@bytedance.com>\n---\n lib/eal/common/malloc_elem.c | 10 +++++-----\n 1 file changed, 5 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/lib/eal/common/malloc_elem.c b/lib/eal/common/malloc_elem.c\nindex 619c040aa3..93a23fa8d4 100644\n--- a/lib/eal/common/malloc_elem.c\n+++ b/lib/eal/common/malloc_elem.c\n@@ -492,7 +492,7 @@ malloc_elem_alloc(struct malloc_elem *elem, size_t size, unsigned align,\n  * be contiguous in memory.\n  */\n static inline void\n-join_elem(struct malloc_elem *elem1, struct malloc_elem *elem2)\n+join_elem(struct malloc_elem *elem1, struct malloc_elem *elem2, bool update_inner)\n {\n \tstruct malloc_elem *next = elem2->next;\n \telem1->size += elem2->size;\n@@ -502,7 +502,7 @@ join_elem(struct malloc_elem *elem1, struct malloc_elem *elem2)\n \t\telem1->heap->last = elem1;\n \telem1->next = next;\n \telem1->dirty |= elem2->dirty;\n-\tif (elem1->pad) {\n+\tif (elem1->pad && update_inner) {\n \t\tstruct malloc_elem *inner = RTE_PTR_ADD(elem1, elem1->pad);\n \t\tinner->size = elem1->size - elem1->pad;\n \t}\n@@ -526,7 +526,7 @@ malloc_elem_join_adjacent_free(struct malloc_elem *elem)\n \n \t\t/* remove from free list, join to this one */\n \t\tmalloc_elem_free_list_remove(elem->next);\n-\t\tjoin_elem(elem, elem->next);\n+\t\tjoin_elem(elem, elem->next, false);\n \n \t\t/* erase header, trailer and pad */\n \t\tmemset(erase, MALLOC_POISON, erase_len);\n@@ -550,7 +550,7 @@ malloc_elem_join_adjacent_free(struct malloc_elem *elem)\n \t\tmalloc_elem_free_list_remove(elem->prev);\n \n \t\tnew_elem = elem->prev;\n-\t\tjoin_elem(new_elem, elem);\n+\t\tjoin_elem(new_elem, elem, false);\n \n \t\t/* erase header, trailer and pad */\n \t\tmemset(erase, MALLOC_POISON, erase_len);\n@@ -683,7 +683,7 @@ malloc_elem_resize(struct malloc_elem *elem, size_t size)\n \t * join the two\n \t */\n \tmalloc_elem_free_list_remove(elem->next);\n-\tjoin_elem(elem, elem->next);\n+\tjoin_elem(elem, elem->next, true);\n \n \tif (elem->size - new_size >= MIN_DATA_SIZE + MALLOC_ELEM_OVERHEAD) {\n \t\t/* now we have a big block together. Lets cut it down a bit, by splitting */\n",
    "prefixes": []
}