get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 43208,
    "url": "http://patches.dpdk.org/api/patches/43208/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20180719162029.30962-1-stephen@networkplumber.org/",
    "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": "<20180719162029.30962-1-stephen@networkplumber.org>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20180719162029.30962-1-stephen@networkplumber.org",
    "date": "2018-07-19T16:20:29",
    "name": "[RFC,v2] mem: poison memory when freed",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "8a3385c734c464f9b1ebf59258ad4aa2ebda8ec7",
    "submitter": {
        "id": 27,
        "url": "http://patches.dpdk.org/api/people/27/?format=api",
        "name": "Stephen Hemminger",
        "email": "stephen@networkplumber.org"
    },
    "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/20180719162029.30962-1-stephen@networkplumber.org/mbox/",
    "series": [
        {
            "id": 676,
            "url": "http://patches.dpdk.org/api/series/676/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=676",
            "date": "2018-07-19T16:20:29",
            "name": "[RFC,v2] mem: poison memory when freed",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/676/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/43208/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/43208/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id E33BD4F9C;\n\tThu, 19 Jul 2018 18:20:34 +0200 (CEST)",
            "from mail-pg1-f196.google.com (mail-pg1-f196.google.com\n\t[209.85.215.196]) by dpdk.org (Postfix) with ESMTP id 70F7A493D\n\tfor <dev@dpdk.org>; Thu, 19 Jul 2018 18:20:33 +0200 (CEST)",
            "by mail-pg1-f196.google.com with SMTP id y4-v6so4205326pgp.9\n\tfor <dev@dpdk.org>; Thu, 19 Jul 2018 09:20:33 -0700 (PDT)",
            "from xeon-e3.wavecable.com (204-195-22-127.wavecable.com.\n\t[204.195.22.127]) by smtp.gmail.com with ESMTPSA id\n\tv82-v6sm21465151pfd.64.2018.07.19.09.20.31\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tThu, 19 Jul 2018 09:20:31 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=networkplumber-org.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id;\n\tbh=QvK0UsH4TqPMirZEPfKx93vg3IrrZZnq3Jhh3P08o2c=;\n\tb=lCfY9TtSRcjLsJscskX9KbCyRt2onevsUB8BH5W1g6wHka0wU6stU2NMY9Ii/0YX9p\n\t5hnsLdfiCifJI77YCJ705Rqs2GYTPf41QcVI9Q+fol6HuGVr37CAS9GtOyDeEJYc1z+2\n\taQfJkBAWLMNSM3psuBInTYdItJm1psk7pREqT1NI/c9ZdTsmrHHo7YyTh8LQGpVtswSA\n\t4J/Wg5o0cPvERvbF5z/rBDXanESCDA2bB8PnqZanEUFLjiumT5I8Yat3XMlnP/tGvXBJ\n\tpIPK9y8SCTBHWZCuQD3JFSDV4yAOti/kBD4zDQHadnnh18obRE7Qr3Zs3XPfg/SaFcpo\n\tS0wA==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id;\n\tbh=QvK0UsH4TqPMirZEPfKx93vg3IrrZZnq3Jhh3P08o2c=;\n\tb=NuytzXnQVubzG4Qg5l0Jxe6Xo62QtibmjqETprMthvz2vyhrO2rOqUN1ZcZX7SHSYm\n\tcsWzZQJY9hgCAkTVpOo+uum/ZaS9pfsXL9wVgIM+xm4GK1nixKLtqf2QjxYnmf/QPDgR\n\tUtMX8uGhi8mKmy+jydIgiUfKX+GbBjhFj4fSzLiLXMmWEWWZS397VqtzRGq5DAKrqosp\n\tkpL7pczLS7aBVmonq4QrJU/kzPtHfcw787SSa5qLqxFP5QIEAx2wlnr019d4ERu9316U\n\ttrEIwiTv/hU/NcVXFfJYbSrXNuV3gn8PElRSpnhu/yAFxwFxhTppbzYlpzl4dz/ULj/c\n\tCuyg==",
        "X-Gm-Message-State": "AOUpUlFTT8GlhkBs9cUC8i0cNhtCwUNVJYnGTL0xAIMPdLrvlyQTzy4K\n\tN2Y6L7ANST5MiIzYGvJdgZrA767XEZ8=",
        "X-Google-Smtp-Source": "AAOMgpetHZSZr3ls+s2WdAHROr8FN7Wab35lZlZE2CoOpynlZVeco1i/AjV2l80Iyw7ub+XGo9OKSA==",
        "X-Received": "by 2002:a65:5304:: with SMTP id\n\tm4-v6mr10498234pgq.250.1532017232189; \n\tThu, 19 Jul 2018 09:20:32 -0700 (PDT)",
        "From": "Stephen Hemminger <stephen@networkplumber.org>",
        "To": "dev@dpdk.org",
        "Cc": "Stephen Hemminger <stephen@networkplumber.org>",
        "Date": "Thu, 19 Jul 2018 09:20:29 -0700",
        "Message-Id": "<20180719162029.30962-1-stephen@networkplumber.org>",
        "X-Mailer": "git-send-email 2.18.0",
        "Subject": "[dpdk-dev] [RFC v2] mem: poison memory when freed",
        "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\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "DPDK malloc library allows broken programs to work because\nthe semantics of zmalloc and malloc are the same.\n\nThis patch enables a  more secure model which will catch\n(and crash) programs that reuse memory already freed if\nRTE_MALLOC_DEBUG is enabled.\n\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\n---\n\nv2\n  - keep original behavior unless RTE_MALLOC_DEBUG is enabled.\n\n lib/librte_eal/common/malloc_elem.c | 17 ++++++++++++++---\n lib/librte_eal/common/rte_malloc.c  |  8 +++++++-\n 2 files changed, 21 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/lib/librte_eal/common/malloc_elem.c b/lib/librte_eal/common/malloc_elem.c\nindex efcb82677198..6fc63c53a75d 100644\n--- a/lib/librte_eal/common/malloc_elem.c\n+++ b/lib/librte_eal/common/malloc_elem.c\n@@ -23,6 +23,16 @@\n #include \"malloc_elem.h\"\n #include \"malloc_heap.h\"\n \n+/* If debugging is enabled, freed memory is set to poison value\n+ * to catch buggy programs. Otherwise, freed memory is zerod\n+ * to avoid having to zero in zmalloc\n+ */\n+#ifdef RTE_MALLOC_DEBUG\n+#define MALLOC_POISON\t       0x6b\n+#else\n+#define MALLOC_POISON\t       0\n+#endif\n+\n size_t\n malloc_elem_find_max_iova_contig(struct malloc_elem *elem, size_t align)\n {\n@@ -476,7 +486,7 @@ malloc_elem_join_adjacent_free(struct malloc_elem *elem)\n \t\tjoin_elem(elem, elem->next);\n \n \t\t/* erase header, trailer and pad */\n-\t\tmemset(erase, 0, erase_len);\n+\t\tmemset(erase, MALLOC_POISON, erase_len);\n \t}\n \n \t/*\n@@ -500,7 +510,7 @@ malloc_elem_join_adjacent_free(struct malloc_elem *elem)\n \t\tjoin_elem(new_elem, elem);\n \n \t\t/* erase header, trailer and pad */\n-\t\tmemset(erase, 0, erase_len);\n+\t\tmemset(erase, MALLOC_POISON, erase_len);\n \n \t\telem = new_elem;\n \t}\n@@ -531,7 +541,8 @@ malloc_elem_free(struct malloc_elem *elem)\n \t/* decrease heap's count of allocated elements */\n \telem->heap->alloc_count--;\n \n-\tmemset(ptr, 0, data_len);\n+\t/* poison memory */\n+\tmemset(ptr, MALLOC_POISON, data_len);\n \n \treturn elem;\n }\ndiff --git a/lib/librte_eal/common/rte_malloc.c b/lib/librte_eal/common/rte_malloc.c\nindex b51a6d111bde..ed253149bb6b 100644\n--- a/lib/librte_eal/common/rte_malloc.c\n+++ b/lib/librte_eal/common/rte_malloc.c\n@@ -70,7 +70,13 @@ rte_malloc(const char *type, size_t size, unsigned align)\n void *\n rte_zmalloc_socket(const char *type, size_t size, unsigned align, int socket)\n {\n-\treturn rte_malloc_socket(type, size, align, socket);\n+\tvoid *ptr = rte_malloc_socket(type, size, align, socket);\n+\n+#ifndef RTE_MALLOC_DEBUG\n+\tif (ptr != NULL)\n+\t\tmemset(ptr, 0, size);\n+#endif\n+\treturn ptr;\n }\n \n /*\n",
    "prefixes": [
        "RFC",
        "v2"
    ]
}