get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 816515,
    "url": "http://patchwork.ozlabs.org/api/patches/816515/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/1505940337-79069-5-git-send-email-keescook@chromium.org/",
    "project": {
        "id": 7,
        "url": "http://patchwork.ozlabs.org/api/projects/7/?format=api",
        "name": "Linux network development",
        "link_name": "netdev",
        "list_id": "netdev.vger.kernel.org",
        "list_email": "netdev@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<1505940337-79069-5-git-send-email-keescook@chromium.org>",
    "list_archive_url": null,
    "date": "2017-09-20T20:45:10",
    "name": "[v3,04/31] dcache: Define usercopy region in dentry_cache slab cache",
    "commit_ref": null,
    "pull_url": null,
    "state": "not-applicable",
    "archived": true,
    "hash": "4224cdf91ef4a3b2bdcdc808d3d79bc75982de7a",
    "submitter": {
        "id": 10641,
        "url": "http://patchwork.ozlabs.org/api/people/10641/?format=api",
        "name": "Kees Cook",
        "email": "keescook@chromium.org"
    },
    "delegate": {
        "id": 34,
        "url": "http://patchwork.ozlabs.org/api/users/34/?format=api",
        "username": "davem",
        "first_name": "David",
        "last_name": "Miller",
        "email": "davem@davemloft.net"
    },
    "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/1505940337-79069-5-git-send-email-keescook@chromium.org/mbox/",
    "series": [
        {
            "id": 4231,
            "url": "http://patchwork.ozlabs.org/api/series/4231/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=4231",
            "date": "2017-09-20T20:45:22",
            "name": "Hardened usercopy whitelisting",
            "version": 3,
            "mbox": "http://patchwork.ozlabs.org/series/4231/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/816515/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/816515/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<netdev-owner@vger.kernel.org>",
        "X-Original-To": "patchwork-incoming@ozlabs.org",
        "Delivered-To": "patchwork-incoming@ozlabs.org",
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org; dkim=pass (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"aDvAvQ1S\"; dkim-atps=neutral"
        ],
        "Received": [
            "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xyByq1cH2z9s8J\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 21 Sep 2017 07:02:43 +1000 (AEST)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751734AbdITUp7 (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tWed, 20 Sep 2017 16:45:59 -0400",
            "from mail-pg0-f52.google.com ([74.125.83.52]:44959 \"EHLO\n\tmail-pg0-f52.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751641AbdITUp5 (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Wed, 20 Sep 2017 16:45:57 -0400",
            "by mail-pg0-f52.google.com with SMTP id j16so2342142pga.1\n\tfor <netdev@vger.kernel.org>; Wed, 20 Sep 2017 13:45:57 -0700 (PDT)",
            "from www.outflux.net\n\t(173-164-112-133-Oregon.hfc.comcastbusiness.net. [173.164.112.133])\n\tby smtp.gmail.com with ESMTPSA id\n\td186sm8641346pfd.117.2017.09.20.13.45.53\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tWed, 20 Sep 2017 13:45:54 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=chromium.org; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=AItuPkxoXP2lQMo2mwVBJC43AWaOTOyiRxkn5bbYjPo=;\n\tb=aDvAvQ1SkZDGOJoKFajT7ucBgLpCSyAEM1GVYDpk9EiYwozOjHJf/Xah/pcvkTbuDE\n\tIrk28pRpF3CruIXTkLfZvixIh9dEbOmQcrBPX50oysuUEfbvgznnH/L7RlM2+TBueAv9\n\t4N85YzvLW1rzVR636P4DvtgGBeojP76B4LWQs=",
        "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=AItuPkxoXP2lQMo2mwVBJC43AWaOTOyiRxkn5bbYjPo=;\n\tb=pSTCSDCB17towbfFo0zS8khw6DWOhmWQYsRsruTNKQD1OqEi7EiUo4CBSZPSKPjK3B\n\t/PiwoDUF+hyV5m1AqeksjQdinpJ0rhu8jIY4COWsVIHuONdqk9NQ8Ug/BJqwpt8oKDEh\n\tmbWfP/wxx1f05mGHw2CPfY25ZRCN0B36BRICuGfLtf1yEnaKuQ+r/Rd6nfwfXEg9opB6\n\tDZ4JNPc8v0D58s1q7DqYlZ5dwMPrmpLstWalLY16WQvdeIK9GuLCgbO21tJXfw/jSn+X\n\tkETe285PhOo6Ayvm6d1WbXXB72Agt7m6FhKA89q1FB25lPw0E3ZUN00FjKCv4P2LtJFZ\n\taUGw==",
        "X-Gm-Message-State": "AHPjjUiaSVHb6hwDSxjBXuVaVbXxrx4Hljem7tXXQQTjJv5RcnuVnMUr\n\tqs7+5q+AyfPbMQconuRMCrUadQ==",
        "X-Google-Smtp-Source": "AOwi7QDbpkm9vl3CE7hQ/RcbWT8LJgDOcR21yLCjyMYy4jx0MyRy+XPcYxPO22PAAvc9fdu3cA+7Cw==",
        "X-Received": "by 10.84.252.130 with SMTP id y2mr3175583pll.68.1505940356706;\n\tWed, 20 Sep 2017 13:45:56 -0700 (PDT)",
        "From": "Kees Cook <keescook@chromium.org>",
        "To": "linux-kernel@vger.kernel.org",
        "Cc": "Kees Cook <keescook@chromium.org>, David Windsor <dave@nullcore.net>,\n\tAlexander Viro <viro@zeniv.linux.org.uk>,\n\tlinux-fsdevel@vger.kernel.org, netdev@vger.kernel.org,\n\tlinux-mm@kvack.org, kernel-hardening@lists.openwall.com",
        "Subject": "[PATCH v3 04/31] dcache: Define usercopy region in dentry_cache\n\tslab cache",
        "Date": "Wed, 20 Sep 2017 13:45:10 -0700",
        "Message-Id": "<1505940337-79069-5-git-send-email-keescook@chromium.org>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1505940337-79069-1-git-send-email-keescook@chromium.org>",
        "References": "<1505940337-79069-1-git-send-email-keescook@chromium.org>",
        "Sender": "netdev-owner@vger.kernel.org",
        "Precedence": "bulk",
        "List-ID": "<netdev.vger.kernel.org>",
        "X-Mailing-List": "netdev@vger.kernel.org"
    },
    "content": "From: David Windsor <dave@nullcore.net>\n\nWhen a dentry name is short enough, it can be stored directly in the\ndentry itself (instead in a separate kmalloc allocation). These dentry\nshort names, stored in struct dentry.d_iname and therefore contained in\nthe dentry_cache slab cache, need to be coped to userspace.\n\ncache object allocation:\n    fs/dcache.c:\n        __d_alloc(...):\n            ...\n            dentry = kmem_cache_alloc(dentry_cache, ...);\n            ...\n            dentry->d_name.name = dentry->d_iname;\n\nexample usage trace:\n    filldir+0xb0/0x140\n    dcache_readdir+0x82/0x170\n    iterate_dir+0x142/0x1b0\n    SyS_getdents+0xb5/0x160\n\n    fs/readdir.c:\n        (called via ctx.actor by dir_emit)\n        filldir(..., const char *name, ...):\n            ...\n            copy_to_user(..., name, namlen)\n\n    fs/libfs.c:\n        dcache_readdir(...):\n            ...\n            next = next_positive(dentry, p, 1)\n            ...\n            dir_emit(..., next->d_name.name, ...)\n\nIn support of usercopy hardening, this patch defines a region in the\ndentry_cache slab cache in which userspace copy operations are allowed.\n\nThis region is known as the slab cache's usercopy region. Slab caches can\nnow check that each copy operation involving cache-managed memory falls\nentirely within the slab's usercopy region.\n\nThis patch is modified from Brad Spengler/PaX Team's PAX_USERCOPY\nwhitelisting code in the last public patch of grsecurity/PaX based on my\nunderstanding of the code. Changes or omissions from the original code are\nmine and don't reflect the original grsecurity/PaX code.\n\nSigned-off-by: David Windsor <dave@nullcore.net>\n[kees: adjust hunks for kmalloc-specific things moved later]\n[kees: adjust commit log, provide usage trace]\nCc: Alexander Viro <viro@zeniv.linux.org.uk>\nCc: linux-fsdevel@vger.kernel.org\nSigned-off-by: Kees Cook <keescook@chromium.org>\n---\n fs/dcache.c | 5 +++--\n 1 file changed, 3 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/fs/dcache.c b/fs/dcache.c\nindex f90141387f01..5f5e7c1fcf4b 100644\n--- a/fs/dcache.c\n+++ b/fs/dcache.c\n@@ -3603,8 +3603,9 @@ static void __init dcache_init(void)\n \t * but it is probably not worth it because of the cache nature\n \t * of the dcache.\n \t */\n-\tdentry_cache = KMEM_CACHE(dentry,\n-\t\tSLAB_RECLAIM_ACCOUNT|SLAB_PANIC|SLAB_MEM_SPREAD|SLAB_ACCOUNT);\n+\tdentry_cache = KMEM_CACHE_USERCOPY(dentry,\n+\t\tSLAB_RECLAIM_ACCOUNT|SLAB_PANIC|SLAB_MEM_SPREAD|SLAB_ACCOUNT,\n+\t\td_iname);\n \n \t/* Hash may have been set up in dcache_init_early */\n \tif (!hashdist)\n",
    "prefixes": [
        "v3",
        "04/31"
    ]
}