get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 47907,
    "url": "https://patches.dpdk.org/api/patches/47907/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20181106214901.1392-2-stephen@networkplumber.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": "<20181106214901.1392-2-stephen@networkplumber.org>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20181106214901.1392-2-stephen@networkplumber.org",
    "date": "2018-11-06T21:48:57",
    "name": "[RFC,1/5] bus/pci: fix allocation of pci device path",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "4842a552b522135ead6562a652c155fc68e38843",
    "submitter": {
        "id": 27,
        "url": "https://patches.dpdk.org/api/people/27/?format=api",
        "name": "Stephen Hemminger",
        "email": "stephen@networkplumber.org"
    },
    "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/20181106214901.1392-2-stephen@networkplumber.org/mbox/",
    "series": [
        {
            "id": 2302,
            "url": "https://patches.dpdk.org/api/series/2302/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=2302",
            "date": "2018-11-06T21:48:56",
            "name": "more Coverity related bug fixes",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/2302/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/47907/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/47907/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 8905D493D;\n\tTue,  6 Nov 2018 22:49:09 +0100 (CET)",
            "from mail-pl1-f196.google.com (mail-pl1-f196.google.com\n\t[209.85.214.196]) by dpdk.org (Postfix) with ESMTP id 5BAFC239\n\tfor <dev@dpdk.org>; Tue,  6 Nov 2018 22:49:06 +0100 (CET)",
            "by mail-pl1-f196.google.com with SMTP id f12-v6so5648983plo.1\n\tfor <dev@dpdk.org>; Tue, 06 Nov 2018 13:49:06 -0800 (PST)",
            "from localhost.localdomain ([167.220.103.1])\n\tby smtp.gmail.com with ESMTPSA id\n\ty1sm5653608pfi.123.2018.11.06.13.49.04\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tTue, 06 Nov 2018 13:49:04 -0800 (PST)"
        ],
        "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:in-reply-to:references;\n\tbh=Yo+6M5Z8uTNoR+ZWOitlpbiBaJzQUeTIyPLNbkEnYnQ=;\n\tb=Wb66D7Nhizq0ivBxtjCoVt/Z5t5aky+uJNjEqQtbdKQ8WewiBk5NNqePpiKHu7A2Fm\n\tNhXq8sVyaY3oQ91XSCWdH2yWdzSdQesUGXvywrjtimt8ogRPKZVCzF8rsytDO/576Pxl\n\tpuQ6HR/7VoEnrFTy0tWPVpd8UlgTMVyuwixV7B4NIGeKyUgrG/+Gm8trM8cRlZB4HcsS\n\tsKBeWzddhos6Cv2RLoJ6XeZFHRBefDoZC0RHJxCdFBX+Xcn8MxAcP8KOYL8E25hDrX4H\n\t1cXHQISSaLHkmWe+x8ZGYDHE6lF10RSPtsPf1gyFjBOg2kkbtj2HqXllhJ4J5HnCIf6D\n\tHh6w==",
        "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:in-reply-to\n\t:references;\n\tbh=Yo+6M5Z8uTNoR+ZWOitlpbiBaJzQUeTIyPLNbkEnYnQ=;\n\tb=krMYHD+H9luJFRAyGRgBAkew2EjyU9/Uw88vvEt9HVVyrtm0oDyOojC0R/WnJ7G2VS\n\tHxVz3JqxUhjiCZlYH99W0aL8gdm6sDNtsmMcTdbNF46Ta2Lb8RpRFT86oE44XOAxOSaU\n\tl5LeE6n/8yOv2bF2rF2WGNJL+N76QtRkbh/1TKbDJs1CZl1Dj5aza5d/GBXkapYdnDWV\n\t/U0lBiou3IKGbpY1cOzqLNN2GNKrmIuiRnIWoXgWQO49T356EXsbjAmJp4cP3/fPh6Vq\n\tr5ybIErR0blO6hBIwwza8UmE711Tcvfp0EDL9wYYdXbE0sIensmYx755ZuLI08gE3cPk\n\tcgOA==",
        "X-Gm-Message-State": "AGRZ1gJ2ZXERF4uoiOhB2upCMk8Z3GoqRVvrAquItYJE+HNwUTT3UJsL\n\tfBf8Ff5YuWLtL5gHVCezEK7j4WSghBs=",
        "X-Google-Smtp-Source": "AJdET5dh2Te00BCGlMlOeQUiOm8NYqk7oOSQAPswqaOZsmdvHjOppK2j0YMyQCU3yQqGsBHIHZ1z2Q==",
        "X-Received": "by 2002:a17:902:3103:: with SMTP id\n\tw3-v6mr28679796plb.51.1541540944875; \n\tTue, 06 Nov 2018 13:49:04 -0800 (PST)",
        "From": "Stephen Hemminger <stephen@networkplumber.org>",
        "To": "dev@dpdk.org",
        "Cc": "Stephen Hemminger <stephen@networkplumber.org>",
        "Date": "Tue,  6 Nov 2018 13:48:57 -0800",
        "Message-Id": "<20181106214901.1392-2-stephen@networkplumber.org>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20181106214901.1392-1-stephen@networkplumber.org>",
        "References": "<20181106214901.1392-1-stephen@networkplumber.org>",
        "Subject": "[dpdk-dev] [RFC 1/5] bus/pci: fix allocation of pci device path",
        "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": "The pci_resource_by_index called strlen() on uninitialized\nmemory which would lead to the wrong size of memory allocated\nfor the path portion of the resource map. This would either cause\nexcessively large allocation, or worse memory corruption.\n\nCoverity Issue: 300868\nFixes: ea9d56226e72 (\"pci: introduce function to map uio resource by index\")\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\n---\n drivers/bus/pci/linux/pci_uio.c | 29 ++++++++++++++---------------\n 1 file changed, 14 insertions(+), 15 deletions(-)",
    "diff": "diff --git a/drivers/bus/pci/linux/pci_uio.c b/drivers/bus/pci/linux/pci_uio.c\nindex a7c14421aa79..112ac51dddcc 100644\n--- a/drivers/bus/pci/linux/pci_uio.c\n+++ b/drivers/bus/pci/linux/pci_uio.c\n@@ -295,14 +295,6 @@ pci_uio_map_resource_by_index(struct rte_pci_device *dev, int res_idx,\n \tloc = &dev->addr;\n \tmaps = uio_res->maps;\n \n-\t/* allocate memory to keep path */\n-\tmaps[map_idx].path = rte_malloc(NULL, strlen(devname) + 1, 0);\n-\tif (maps[map_idx].path == NULL) {\n-\t\tRTE_LOG(ERR, EAL, \"Cannot allocate memory for path: %s\\n\",\n-\t\t\t\tstrerror(errno));\n-\t\treturn -1;\n-\t}\n-\n \t/*\n \t * open resource file, to mmap it\n \t */\n@@ -335,10 +327,19 @@ pci_uio_map_resource_by_index(struct rte_pci_device *dev, int res_idx,\n \t\tif (fd < 0) {\n \t\t\tRTE_LOG(ERR, EAL, \"Cannot open %s: %s\\n\",\n \t\t\t\tdevname, strerror(errno));\n-\t\t\tgoto error;\n+\t\t\treturn -1;\n \t\t}\n \t}\n \n+\t/* allocate memory to keep path */\n+\tmaps[map_idx].path = rte_malloc(NULL, strlen(devname) + 1, 0);\n+\tif (maps[map_idx].path == NULL) {\n+\t\tRTE_LOG(ERR, EAL, \"Cannot allocate memory for path: %s\\n\",\n+\t\t\t\tstrerror(errno));\n+\t\tclose(fd);\n+\t\treturn -1;\n+\t}\n+\n \t/* try mapping somewhere close to the end of hugepages */\n \tif (pci_map_addr == NULL)\n \t\tpci_map_addr = pci_find_max_end_va();\n@@ -346,8 +347,10 @@ pci_uio_map_resource_by_index(struct rte_pci_device *dev, int res_idx,\n \tmapaddr = pci_map_resource(pci_map_addr, fd, 0,\n \t\t\t(size_t)dev->mem_resource[res_idx].len, 0);\n \tclose(fd);\n-\tif (mapaddr == MAP_FAILED)\n-\t\tgoto error;\n+\tif (mapaddr == MAP_FAILED) {\n+\t\trte_free(maps[map_idx].path);\n+\t\treturn -1;\n+\t}\n \n \tpci_map_addr = RTE_PTR_ADD(mapaddr,\n \t\t\t(size_t)dev->mem_resource[res_idx].len);\n@@ -360,10 +363,6 @@ pci_uio_map_resource_by_index(struct rte_pci_device *dev, int res_idx,\n \tdev->mem_resource[res_idx].addr = mapaddr;\n \n \treturn 0;\n-\n-error:\n-\trte_free(maps[map_idx].path);\n-\treturn -1;\n }\n \n #if defined(RTE_ARCH_X86)\n",
    "prefixes": [
        "RFC",
        "1/5"
    ]
}