get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 806790,
    "url": "http://patchwork.ozlabs.org/api/patches/806790/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/1503956111-36652-22-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": "<1503956111-36652-22-git-send-email-keescook@chromium.org>",
    "list_archive_url": null,
    "date": "2017-08-28T21:35:02",
    "name": "[v2,21/30] sctp: Define usercopy region in SCTP proto slab cache",
    "commit_ref": null,
    "pull_url": null,
    "state": "not-applicable",
    "archived": true,
    "hash": "164aadff4fdcd280fac726de93b5e0321cba2d3e",
    "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/1503956111-36652-22-git-send-email-keescook@chromium.org/mbox/",
    "series": [
        {
            "id": 266,
            "url": "http://patchwork.ozlabs.org/api/series/266/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=266",
            "date": "2017-08-28T21:35:01",
            "name": null,
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/266/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/806790/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/806790/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=\"VyupHHLk\"; dkim-atps=neutral"
        ],
        "Received": [
            "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xh55x5wdyz9t5g\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 29 Aug 2017 07:49:57 +1000 (AEST)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751516AbdH1VoA (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tMon, 28 Aug 2017 17:44:00 -0400",
            "from mail-pg0-f49.google.com ([74.125.83.49]:34369 \"EHLO\n\tmail-pg0-f49.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751340AbdH1Vn6 (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Mon, 28 Aug 2017 17:43:58 -0400",
            "by mail-pg0-f49.google.com with SMTP id y15so5062119pgc.1\n\tfor <netdev@vger.kernel.org>; Mon, 28 Aug 2017 14:43:58 -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\tc23sm2190039pfc.60.2017.08.28.14.43.52\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tMon, 28 Aug 2017 14:43: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=UKatO1gLtRqX3aqTd9wE75GOeS3kdlJYf3ZMjJeA9oM=;\n\tb=VyupHHLkksmag6GtHY/1UVDgel4XXKpavxgQqDilnnQDtLuxOEPuUemWIiyIyLbfVU\n\t7tVLuMZEPHa37PfVq4/1PskVjXVofgvHJT8rR+wtr3p2jeXb4VHTu65Y9pLykE0pRShk\n\t9efalgFJIL+rZO+pjgkKbw3dG/X+6oG5EcEMs=",
        "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=UKatO1gLtRqX3aqTd9wE75GOeS3kdlJYf3ZMjJeA9oM=;\n\tb=cH521lE79Kd403L83OnSsg29EMwCwV3YLgKTUOkWY74txcUcbvIKWk3Cb95H2diPPk\n\t8opWF9sTYY2yTc98CpRqOUppHgCu+GoJ0qcFdG2SaNEZU0mmAYp2jl4/SYZ2zL9Jm/bQ\n\tMK5QYX/Y04JRlXTn5RaOSxxfCMThaQ4WoAmJwd39sZ88Viv1s7CakHFW7bcK2TWsoKAO\n\tnCszAujGkHZS1XRKGzxSiCgeCcY+SdbnHz9eZPAGua+2QUzBcY3+IqG3U3Dsbe/5twWu\n\t2Psq55SDWgW6y/UF5VUegIJj6QG/XU9/EmK6EZ0H96lxYgQVpqAJYZ4xAiClrecO6rPX\n\tRsMQ==",
        "X-Gm-Message-State": "AHYfb5gK/Fa57irA04sVSfbCW1T1GJPY/OMcmczSR769/1fW7fN/qIKd\n\trRGAWUH8LTHkhda/",
        "X-Received": "by 10.84.210.196 with SMTP id a62mr2367142pli.382.1503956638262; \n\tMon, 28 Aug 2017 14:43:58 -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\tVlad Yasevich <vyasevich@gmail.com>, Neil Horman <nhorman@tuxdriver.com>,\n\t\"David S. Miller\" <davem@davemloft.net>,\n\tlinux-sctp@vger.kernel.org, netdev@vger.kernel.org,\n\tlinux-mm@kvack.org, kernel-hardening@lists.openwall.com",
        "Subject": "[PATCH v2 21/30] sctp: Define usercopy region in SCTP proto slab\n\tcache",
        "Date": "Mon, 28 Aug 2017 14:35:02 -0700",
        "Message-Id": "<1503956111-36652-22-git-send-email-keescook@chromium.org>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1503956111-36652-1-git-send-email-keescook@chromium.org>",
        "References": "<1503956111-36652-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\nThe SCTP socket event notification subscription information need to be\ncopied to/from userspace. In support of usercopy hardening, this patch\ndefines a region in the struct proto slab cache in which userspace copy\noperations are allowed. Additionally moves the usercopy fields to be\nadjacent for the region to cover both.\n\nexample usage trace:\n\n    net/sctp/socket.c:\n        sctp_getsockopt_events(...):\n            ...\n            copy_to_user(..., &sctp_sk(sk)->subscribe, len)\n\n        sctp_setsockopt_events(...):\n            ...\n            copy_from_user(&sctp_sk(sk)->subscribe, ..., optlen)\n\n        sctp_getsockopt_initmsg(...):\n            ...\n            copy_to_user(..., &sctp_sk(sk)->initmsg, len)\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: split from network patch, move struct member adjacent, provide usage]\nCc: Vlad Yasevich <vyasevich@gmail.com>\nCc: Neil Horman <nhorman@tuxdriver.com>\nCc: \"David S. Miller\" <davem@davemloft.net>\nCc: linux-sctp@vger.kernel.org\nCc: netdev@vger.kernel.org\nSigned-off-by: Kees Cook <keescook@chromium.org>\n---\n include/net/sctp/structs.h | 9 +++++++--\n net/sctp/socket.c          | 4 ++++\n 2 files changed, 11 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h\nindex 5ab29af8ca8a..f1d7810e200e 100644\n--- a/include/net/sctp/structs.h\n+++ b/include/net/sctp/structs.h\n@@ -202,12 +202,17 @@ struct sctp_sock {\n \t/* Flags controlling Heartbeat, SACK delay, and Path MTU Discovery. */\n \t__u32 param_flags;\n \n-\tstruct sctp_initmsg initmsg;\n \tstruct sctp_rtoinfo rtoinfo;\n \tstruct sctp_paddrparams paddrparam;\n-\tstruct sctp_event_subscribe subscribe;\n \tstruct sctp_assocparams assocparams;\n \n+\t/*\n+\t * These two structures must be grouped together for the usercopy\n+\t * whitelist region.\n+\t */\n+\tstruct sctp_event_subscribe subscribe;\n+\tstruct sctp_initmsg initmsg;\n+\n \tint user_frag;\n \n \t__u32 autoclose;\ndiff --git a/net/sctp/socket.c b/net/sctp/socket.c\nindex 1db478e34520..c8784cb216e4 100644\n--- a/net/sctp/socket.c\n+++ b/net/sctp/socket.c\n@@ -8235,6 +8235,10 @@ struct proto sctp_prot = {\n \t.unhash      =\tsctp_unhash,\n \t.get_port    =\tsctp_get_port,\n \t.obj_size    =  sizeof(struct sctp_sock),\n+\t.useroffset  =  offsetof(struct sctp_sock, subscribe),\n+\t.usersize    =  offsetof(struct sctp_sock, initmsg) -\n+\t\t\t\toffsetof(struct sctp_sock, subscribe) +\n+\t\t\t\tsizeof_field(struct sctp_sock, initmsg),\n \t.sysctl_mem  =  sysctl_sctp_mem,\n \t.sysctl_rmem =  sysctl_sctp_rmem,\n \t.sysctl_wmem =  sysctl_sctp_wmem,\n",
    "prefixes": [
        "v2",
        "21/30"
    ]
}