Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/816500/?format=api
{ "id": 816500, "url": "http://patchwork.ozlabs.org/api/patches/816500/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/1505940337-79069-26-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-26-git-send-email-keescook@chromium.org>", "list_archive_url": null, "date": "2017-09-20T20:45:31", "name": "[v3,25/31] fork: Define usercopy region in thread_stack slab caches", "commit_ref": null, "pull_url": null, "state": "not-applicable", "archived": true, "hash": "6a8e5bf74db87098ec7e72f3145c5e32ae3e433b", "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-26-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/816500/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/816500/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=\"OkJoDSIR\"; dkim-atps=neutral" ], "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xyBn11cwvz9s8J\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 21 Sep 2017 06:54:13 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752201AbdITUxK (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tWed, 20 Sep 2017 16:53:10 -0400", "from mail-pg0-f47.google.com ([74.125.83.47]:56983 \"EHLO\n\tmail-pg0-f47.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1752155AbdITUw6 (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Wed, 20 Sep 2017 16:52:58 -0400", "by mail-pg0-f47.google.com with SMTP id 7so2332941pgd.13\n\tfor <netdev@vger.kernel.org>; Wed, 20 Sep 2017 13:52: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\t133sm10278395pfy.2.2017.09.20.13.52.50\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tWed, 20 Sep 2017 13:52:52 -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=x4S+mwfUnv9K1Bnlak1ybFpRjVXdf/L3fqTsDlwg50M=;\n\tb=OkJoDSIRrhJqpumEbdgIZUtTt0WTnFGcLHY08vORZXJnpk/j/KmhcAIKKdkFiFjvAx\n\tioqT+4Da6tO6CJ3TbzmDxLOZBcU8KkJ6+iPOqUO5kf7Re8Tif63lwgN5JGhAFcmAtPth\n\tzpxasFNuBgw549mVSmMShMbbu/nmALPt5E/uw=", "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=x4S+mwfUnv9K1Bnlak1ybFpRjVXdf/L3fqTsDlwg50M=;\n\tb=PkqhguB4bFuOyAqqtQzsSu+JD5T7n9gCb6KVovdV/xaxvfp8BUX4sIM4u+Q0timqkH\n\tWyN0uI3XqR4a9ra/RoXhyDVaQxxqzM0YlT5BOGZzD9Rsq9vD5UJhPscd9mh7W5CyJg8Y\n\txdAyltQPf44fyAl+Z3btAVf5+gR0CMyBYds1KZmejimrOBt4Sst6O7C01hq045t01gFs\n\t6dtWJ4RTOr8XcN0OOtZ+f7FWBgH5viLotz8++L5KyaOap/OYTUrYWBbOyrk8p6UWIrjL\n\tFR320wiZzAEw8cKlhg2pBFyVytEbm1aTYyPiS0EiScX7u/UiBjyT2ZSeK5dDBkwodzIb\n\t2ZOQ==", "X-Gm-Message-State": "AHPjjUjhK7e1IufRnrKYVwoOczaoP7NmVf0/fgnN64HwNwZiiu+ulhCa\n\tzt/mNbnUz6m2KPCdrDxFQDx7hg==", "X-Google-Smtp-Source": "AOwi7QDdvNIGCSvzoIudS00ab5XQGn7EaTU8A7SYRyxuUPb1jMoqLe/+NlgZxYQX2Chlylk5j/9cJw==", "X-Received": "by 10.99.125.82 with SMTP id m18mr3464839pgn.347.1505940778162; \n\tWed, 20 Sep 2017 13:52: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\tIngo Molnar <mingo@kernel.org>,\n\tAndrew Morton <akpm@linux-foundation.org>,\n\tThomas Gleixner <tglx@linutronix.de>, Andy Lutomirski <luto@kernel.org>,\n\tlinux-fsdevel@vger.kernel.org, netdev@vger.kernel.org,\n\tlinux-mm@kvack.org, kernel-hardening@lists.openwall.com", "Subject": "[PATCH v3 25/31] fork: Define usercopy region in thread_stack slab\n\tcaches", "Date": "Wed, 20 Sep 2017 13:45:31 -0700", "Message-Id": "<1505940337-79069-26-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\nIn support of usercopy hardening, this patch defines a region in the\nthread_stack slab caches in which userspace copy operations are allowed.\nSince the entire thread_stack needs to be available to userspace, the\nentire slab contents are whitelisted. Note that the slab-based thread\nstack is only present on systems with THREAD_SIZE < PAGE_SIZE and\n!CONFIG_VMAP_STACK.\n\ncache object allocation:\n kernel/fork.c:\n alloc_thread_stack_node(...):\n return kmem_cache_alloc_node(thread_stack_cache, ...)\n\n dup_task_struct(...):\n ...\n stack = alloc_thread_stack_node(...)\n ...\n tsk->stack = stack;\n\n copy_process(...):\n ...\n dup_task_struct(...)\n\n _do_fork(...):\n ...\n copy_process(...)\n\nThis region is known as the slab cache's usercopy region. Slab caches\ncan now check that each copy operation involving cache-managed memory\nfalls entirely 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 commit log, split patch, provide usage trace]\nCc: Ingo Molnar <mingo@kernel.org>\nCc: Andrew Morton <akpm@linux-foundation.org>\nCc: Thomas Gleixner <tglx@linutronix.de>\nCc: Andy Lutomirski <luto@kernel.org>\nSigned-off-by: Kees Cook <keescook@chromium.org>\nAcked-by: Rik van Riel <riel@redhat.com>\n---\nI wasn't able to test this, so anyone with a system that can try running\nwith a large PAGE_SIZE and without VMAP_STACK would be appreciated.\n---\n kernel/fork.c | 5 +++--\n 1 file changed, 3 insertions(+), 2 deletions(-)", "diff": "diff --git a/kernel/fork.c b/kernel/fork.c\nindex dc1437f8b702..720109dc723a 100644\n--- a/kernel/fork.c\n+++ b/kernel/fork.c\n@@ -278,8 +278,9 @@ static void free_thread_stack(struct task_struct *tsk)\n \n void thread_stack_cache_init(void)\n {\n-\tthread_stack_cache = kmem_cache_create(\"thread_stack\", THREAD_SIZE,\n-\t\t\t\t\t THREAD_SIZE, 0, NULL);\n+\tthread_stack_cache = kmem_cache_create_usercopy(\"thread_stack\",\n+\t\t\t\t\tTHREAD_SIZE, THREAD_SIZE, 0, 0,\n+\t\t\t\t\tTHREAD_SIZE, NULL);\n \tBUG_ON(thread_stack_cache == NULL);\n }\n # endif\n", "prefixes": [ "v3", "25/31" ] }