get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 811890,
    "url": "http://patchwork.ozlabs.org/api/patches/811890/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/1504910713-7094-32-git-send-email-linuxram@us.ibm.com/",
    "project": {
        "id": 2,
        "url": "http://patchwork.ozlabs.org/api/projects/2/?format=api",
        "name": "Linux PPC development",
        "link_name": "linuxppc-dev",
        "list_id": "linuxppc-dev.lists.ozlabs.org",
        "list_email": "linuxppc-dev@lists.ozlabs.org",
        "web_url": "https://github.com/linuxppc/wiki/wiki",
        "scm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git",
        "webscm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/",
        "list_archive_url": "https://lore.kernel.org/linuxppc-dev/",
        "list_archive_url_format": "https://lore.kernel.org/linuxppc-dev/{}/",
        "commit_url_format": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id={}"
    },
    "msgid": "<1504910713-7094-32-git-send-email-linuxram@us.ibm.com>",
    "list_archive_url": "https://lore.kernel.org/linuxppc-dev/1504910713-7094-32-git-send-email-linuxram@us.ibm.com/",
    "date": "2017-09-08T22:45:11",
    "name": "[23/25] powerpc: Deliver SEGV signal on pkey violation",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": false,
    "hash": "d313cb96504b10419920e89b54d7cf0c0ab36f4e",
    "submitter": {
        "id": 2667,
        "url": "http://patchwork.ozlabs.org/api/people/2667/?format=api",
        "name": "Ram Pai",
        "email": "linuxram@us.ibm.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/1504910713-7094-32-git-send-email-linuxram@us.ibm.com/mbox/",
    "series": [
        {
            "id": 2303,
            "url": "http://patchwork.ozlabs.org/api/series/2303/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=2303",
            "date": "2017-09-08T22:44:40",
            "name": "powerpc: Free up RPAGE_RSV bits",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/2303/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/811890/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/811890/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>",
        "X-Original-To": [
            "patchwork-incoming@ozlabs.org",
            "linuxppc-dev@lists.ozlabs.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@ozlabs.org",
            "linuxppc-dev@lists.ozlabs.org"
        ],
        "Received": [
            "from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xpv8l2421z9sRY\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSat,  9 Sep 2017 09:45:59 +1000 (AEST)",
            "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xpv8l0hsTzDrV9\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSat,  9 Sep 2017 09:45:59 +1000 (AEST)",
            "from mail-qt0-x244.google.com (mail-qt0-x244.google.com\n\t[IPv6:2607:f8b0:400d:c0d::244])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xpss81HV1zDrd1\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tSat,  9 Sep 2017 08:47:24 +1000 (AEST)",
            "by mail-qt0-x244.google.com with SMTP id h21so2358588qth.4\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tFri, 08 Sep 2017 15:47:24 -0700 (PDT)",
            "from localhost.localdomain (50-39-103-96.bvtn.or.frontiernet.net.\n\t[50.39.103.96]) by smtp.gmail.com with ESMTPSA id\n\tx124sm2033726qka.85.2017.09.08.15.47.20\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tFri, 08 Sep 2017 15:47:21 -0700 (PDT)"
        ],
        "Authentication-Results": [
            "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"kjZL5NCK\"; dkim-atps=neutral",
            "lists.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"kjZL5NCK\"; dkim-atps=neutral",
            "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=gmail.com\n\t(client-ip=2607:f8b0:400d:c0d::244; helo=mail-qt0-x244.google.com;\n\tenvelope-from=ram.n.pai@gmail.com; receiver=<UNKNOWN>)",
            "lists.ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"kjZL5NCK\"; dkim-atps=neutral"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=sender:from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=v/zlfLWMndbCoOQ0qHViMARjO/TYwyJWRfKtGKNsVv8=;\n\tb=kjZL5NCKYyDU7pvHTLEMrNzAyIgQUvnFj2/sHa8BCLBHKfJfQRBli3soD4dN2wBIF+\n\tJddVVEZVS0zTJhWXN5btDETTKSDQdW2jJ/DLvUS7Ybk3O/PlpGnmDTz8L2+c+Lw4AWIC\n\tFeTuoRGwBdmduqnFv+DW7sR7+byxaF3/sjiaEaevmyAneGM7K4im3601LfWdH+dh6pc8\n\txsf7r9j/Ejns/0y7qBNx0Vecy1TMEHZutWFkfsQVggPqRn3oV+VL4P7LkQ97TMHlF+9y\n\tdSKY8D+X4BUeal2JtC3Uy7uhi5OwOBcvin5sj9TmSZ47RtwNml76jOMfQVrcaypobUac\n\toSNQ==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:sender:from:to:cc:subject:date:message-id\n\t:in-reply-to:references;\n\tbh=v/zlfLWMndbCoOQ0qHViMARjO/TYwyJWRfKtGKNsVv8=;\n\tb=agE+8tOqYK+1pIqst5u87GMtOnibxKa5HIt6ssQyO7ixA7sDwOik2tcegkvZ0GF4Db\n\tjE4TuO3uWOG4xZYlUgFrbarjJwcCtjTMDBYFXWuyhQMDXy+3HdxVsAtd+poqIy/g2As9\n\tx43OU6TBmMXaxg0o/VF27pSTdCE5DJ6AjrGiuS/uI4YXeIBH9/UDPRijA2DDQRk/Eo1Y\n\t4IBz6wY3FD/fzrreagRnmMoGtPfLXD8OCXC4yEODBId9hMS9p6IU1vHB4W3HH2zJdoUz\n\tss++NBZm3bkUUyrJePn0juxpReI4r6gwM9r2U7+HsbHfXrjRrOT91MnGM9ySs59MWudC\n\tWp8A==",
        "X-Gm-Message-State": "AHPjjUj+UHR09T2cps+pSYt80PJ537jbdWkrHJIsRDAfo7r5Brz3OICE\n\tt0rNp/xxsTIVJoHd",
        "X-Google-Smtp-Source": "AOwi7QC95p8vEBb8mOmiGXiaWZcBERX60T6YuuNdN38E/uTeCg3DUkWalXZQkl4VUjAulPwFijOWGw==",
        "X-Received": "by 10.200.8.72 with SMTP id x8mr6172882qth.108.1504910842318;\n\tFri, 08 Sep 2017 15:47:22 -0700 (PDT)",
        "From": "Ram Pai <linuxram@us.ibm.com>",
        "To": "mpe@ellerman.id.au,\n\tlinuxppc-dev@lists.ozlabs.org",
        "Subject": "[PATCH 23/25] powerpc: Deliver SEGV signal on pkey violation",
        "Date": "Fri,  8 Sep 2017 15:45:11 -0700",
        "Message-Id": "<1504910713-7094-32-git-send-email-linuxram@us.ibm.com>",
        "X-Mailer": "git-send-email 1.7.1",
        "In-Reply-To": "<1504910713-7094-1-git-send-email-linuxram@us.ibm.com>",
        "References": "<1504910713-7094-1-git-send-email-linuxram@us.ibm.com>",
        "X-BeenThere": "linuxppc-dev@lists.ozlabs.org",
        "X-Mailman-Version": "2.1.23",
        "Precedence": "list",
        "List-Id": "Linux on PowerPC Developers Mail List\n\t<linuxppc-dev.lists.ozlabs.org>",
        "List-Unsubscribe": "<https://lists.ozlabs.org/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.ozlabs.org/pipermail/linuxppc-dev/>",
        "List-Post": "<mailto:linuxppc-dev@lists.ozlabs.org>",
        "List-Help": "<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>",
        "List-Subscribe": "<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>",
        "Cc": "ebiederm@xmission.com, linuxram@us.ibm.com, mhocko@kernel.org,\n\tpaulus@samba.org, aneesh.kumar@linux.vnet.ibm.com,\n\tbauerman@linux.vnet.ibm.com, khandual@linux.vnet.ibm.com",
        "Errors-To": "linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org",
        "Sender": "\"Linuxppc-dev\"\n\t<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>"
    },
    "content": "The value of the pkey, whose protection got violated,\nis made available in si_pkey field of the siginfo structure.\n\nAlso keep the thread's pkey-register fields up2date.\n\nSigned-off-by: Ram Pai <linuxram@us.ibm.com>\n---\n arch/powerpc/kernel/traps.c |   22 ++++++++++++++++++++++\n 1 files changed, 22 insertions(+), 0 deletions(-)",
    "diff": "diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c\nindex ec74e20..f2a310d 100644\n--- a/arch/powerpc/kernel/traps.c\n+++ b/arch/powerpc/kernel/traps.c\n@@ -20,6 +20,7 @@\n #include <linux/sched/debug.h>\n #include <linux/kernel.h>\n #include <linux/mm.h>\n+#include <linux/pkeys.h>\n #include <linux/stddef.h>\n #include <linux/unistd.h>\n #include <linux/ptrace.h>\n@@ -265,6 +266,15 @@ void user_single_step_siginfo(struct task_struct *tsk,\n \tinfo->si_addr = (void __user *)regs->nip;\n }\n \n+#ifdef CONFIG_PPC64_MEMORY_PROTECTION_KEYS\n+static void fill_sig_info_pkey(int si_code, siginfo_t *info, unsigned long addr)\n+{\n+\tif (info->si_signo != SIGSEGV || si_code != SEGV_PKUERR)\n+\t\treturn;\n+\tinfo->si_pkey = get_paca()->paca_pkey;\n+}\n+#endif /* CONFIG_PPC64_MEMORY_PROTECTION_KEYS */\n+\n void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr)\n {\n \tsiginfo_t info;\n@@ -292,6 +302,18 @@ void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr)\n \tinfo.si_signo = signr;\n \tinfo.si_code = code;\n \tinfo.si_addr = (void __user *) addr;\n+\n+#ifdef CONFIG_PPC64_MEMORY_PROTECTION_KEYS\n+\t/*\n+\t * update the thread's pkey related fields.\n+\t * core-dump handlers and other sub-systems\n+\t * depend on those values.\n+\t */\n+\tthread_pkey_regs_save(&current->thread);\n+\t/* update the violated-key value */\n+\tfill_sig_info_pkey(code, &info, addr);\n+#endif /* CONFIG_PPC64_MEMORY_PROTECTION_KEYS */\n+\n \tforce_sig_info(signr, &info, current);\n }\n \n",
    "prefixes": [
        "23/25"
    ]
}