Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/816490/?format=api
{ "id": 816490, "url": "http://patchwork.ozlabs.org/api/patches/816490/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/1505940337-79069-11-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-11-git-send-email-keescook@chromium.org>", "list_archive_url": null, "date": "2017-09-20T20:45:16", "name": "[v3,10/31] befs: Define usercopy region in befs_inode_cache slab cache", "commit_ref": null, "pull_url": null, "state": "not-applicable", "archived": true, "hash": "596428182cd0d625bca8f6c2d37d43560e110e23", "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-11-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/816490/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/816490/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=\"furlNcR3\"; dkim-atps=neutral" ], "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xyBgg2f0Cz9s8J\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 21 Sep 2017 06:49:35 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752047AbdITUt0 (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tWed, 20 Sep 2017 16:49:26 -0400", "from mail-pf0-f179.google.com ([209.85.192.179]:43977 \"EHLO\n\tmail-pf0-f179.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751878AbdITUqI (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Wed, 20 Sep 2017 16:46:08 -0400", "by mail-pf0-f179.google.com with SMTP id y29so2118554pff.0\n\tfor <netdev@vger.kernel.org>; Wed, 20 Sep 2017 13:46:08 -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\te66sm9407448pfb.48.2017.09.20.13.45.59\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tWed, 20 Sep 2017 13:46:00 -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=ZD70sgZJcUbeGG5tGfV/yFB0j+7o6bDSFDi/MC59qys=;\n\tb=furlNcR31jAI0t3DtZj/zoyjN7EperexIzBi0oBZw93xK6x/naHuLTqRcFADD/5MsE\n\t4whg2r8VsYUkHVolFrh3lTOv/Qfe1fLi6hmk/gueYjMCATMcNBmnOjBktvLZcK46qN93\n\tnIqjRP6fHLk4+E/qPze0rgy+v0jFPO0tn3RuM=", "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=ZD70sgZJcUbeGG5tGfV/yFB0j+7o6bDSFDi/MC59qys=;\n\tb=TAdhrWpW4W/xwTXgB1cmszh1aWLpZZNmw8r59JO22maD84jAD4H4+OYaMp6Sz6Q2IC\n\tFBHPJ498py6CPXNaPk/vCMbaU7/StUn631y3Rw8J/0AnPSbOYzbnUizDhn942dThjqKM\n\tBeGDPSZJMsLE5bzeFdtHD5ahj4WiHLDsAc+q6XTPLQ0U7HpP+MXIqN0c5daMthbo3Nsl\n\tKajSFy2FxnIbg+XcrrvT+mZsdokBnN1lHtR0RYvNaMYFrDZDt9UsoMF+YQ8V3yQ9rk6z\n\twEpou9mjwpCErJvujp34jcyE4rYTgUgmDj8tbBDE+DPrff9N9uwM7eSfBSnmvB8VgO4d\n\tItZA==", "X-Gm-Message-State": "AHPjjUjrATfYUqCXzRCAxsqtpqwYm6VsP6KJZVzA79d1vS2NiyGXa47b\n\tT8wBmqikdlFx+Q5iy7vzxInYKw==", "X-Google-Smtp-Source": "AOwi7QDopldAOLVNl6Fxd3dAtyJ6TNpYyjkXbxPqIra0a2+az8IAUz7EjvoC2aGnW4CZOs1pEaH/Sg==", "X-Received": "by 10.98.100.69 with SMTP id y66mr3441176pfb.337.1505940367932; \n\tWed, 20 Sep 2017 13:46:07 -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\tLuis de Bethencourt <luisbg@kernel.org>,\n\tSalah Triki <salah.triki@gmail.com>,\n\tlinux-fsdevel@vger.kernel.org, netdev@vger.kernel.org,\n\tlinux-mm@kvack.org, kernel-hardening@lists.openwall.com", "Subject": "[PATCH v3 10/31] befs: Define usercopy region in befs_inode_cache\n\tslab cache", "Date": "Wed, 20 Sep 2017 13:45:16 -0700", "Message-Id": "<1505940337-79069-11-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\nbefs symlink pathnames, stored in struct befs_inode_info.i_data.symlink\nand therefore contained in the befs_inode_cache slab cache, need to be\ncopied to/from userspace.\n\ncache object allocation:\n fs/befs/linuxvfs.c:\n befs_alloc_inode(...):\n ...\n bi = kmem_cache_alloc(befs_inode_cachep, GFP_KERNEL);\n ...\n return &bi->vfs_inode;\n\n befs_iget(...):\n ...\n strlcpy(befs_ino->i_data.symlink, raw_inode->data.symlink,\n BEFS_SYMLINK_LEN);\n ...\n inode->i_link = befs_ino->i_data.symlink;\n\nexample usage trace:\n readlink_copy+0x43/0x70\n vfs_readlink+0x62/0x110\n SyS_readlinkat+0x100/0x130\n\n fs/namei.c:\n readlink_copy(..., link):\n ...\n copy_to_user(..., link, len);\n\n (inlined in vfs_readlink)\n generic_readlink(dentry, ...):\n struct inode *inode = d_inode(dentry);\n const char *link = inode->i_link;\n ...\n readlink_copy(..., link);\n\nIn support of usercopy hardening, this patch defines a region in the\nbefs_inode_cache slab cache in which userspace copy operations are\nallowed.\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 commit log, provide usage trace]\nCc: Luis de Bethencourt <luisbg@kernel.org>\nCc: Salah Triki <salah.triki@gmail.com>\nSigned-off-by: Kees Cook <keescook@chromium.org>\nAcked-by: Luis de Bethencourt <luisbg@kernel.org>\n---\n fs/befs/linuxvfs.c | 14 +++++++++-----\n 1 file changed, 9 insertions(+), 5 deletions(-)", "diff": "diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c\nindex a92355cc453b..e5dcd26003dc 100644\n--- a/fs/befs/linuxvfs.c\n+++ b/fs/befs/linuxvfs.c\n@@ -444,11 +444,15 @@ static struct inode *befs_iget(struct super_block *sb, unsigned long ino)\n static int __init\n befs_init_inodecache(void)\n {\n-\tbefs_inode_cachep = kmem_cache_create(\"befs_inode_cache\",\n-\t\t\t\t\t sizeof (struct befs_inode_info),\n-\t\t\t\t\t 0, (SLAB_RECLAIM_ACCOUNT|\n-\t\t\t\t\t\tSLAB_MEM_SPREAD|SLAB_ACCOUNT),\n-\t\t\t\t\t init_once);\n+\tbefs_inode_cachep = kmem_cache_create_usercopy(\"befs_inode_cache\",\n+\t\t\t\tsizeof(struct befs_inode_info), 0,\n+\t\t\t\t(SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD|\n+\t\t\t\t\tSLAB_ACCOUNT),\n+\t\t\t\toffsetof(struct befs_inode_info,\n+\t\t\t\t\ti_data.symlink),\n+\t\t\t\tsizeof_field(struct befs_inode_info,\n+\t\t\t\t\ti_data.symlink),\n+\t\t\t\tinit_once);\n \tif (befs_inode_cachep == NULL)\n \t\treturn -ENOMEM;\n \n", "prefixes": [ "v3", "10/31" ] }