get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2229032,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2229032/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-um/patch/a6d39afb167871e0459946dfd6b28bc994ae3c81.1777306795.git.chleroy@kernel.org/",
    "project": {
        "id": 60,
        "url": "http://patchwork.ozlabs.org/api/1.1/projects/60/?format=api",
        "name": "User-mode Linux Development",
        "link_name": "linux-um",
        "list_id": "linux-um.lists.infradead.org",
        "list_email": "linux-um@lists.infradead.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<a6d39afb167871e0459946dfd6b28bc994ae3c81.1777306795.git.chleroy@kernel.org>",
    "date": "2026-04-27T17:13:42",
    "name": "[RFC,v1,1/9] uaccess: Split check_zeroed_user() out of usercopy.c",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "edf1ca774360845bd87b9c22c0d6b31a45356ab3",
    "submitter": {
        "id": 92089,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/92089/?format=api",
        "name": "Christophe Leroy (CS GROUP)",
        "email": "chleroy@kernel.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-um/patch/a6d39afb167871e0459946dfd6b28bc994ae3c81.1777306795.git.chleroy@kernel.org/mbox/",
    "series": [
        {
            "id": 501693,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/501693/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-um/list/?series=501693",
            "date": "2026-04-27T17:13:41",
            "name": "uaccess: Convert small fixed size copy_{to/from}_user() to scoped user access",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/501693/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2229032/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2229032/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "\n <linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n secure) header.d=lists.infradead.org header.i=@lists.infradead.org\n header.a=rsa-sha256 header.s=bombadil.20210309 header.b=O/l/pf98;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=ccnzw+ca;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=none (no SPF record) smtp.mailfrom=lists.infradead.org\n (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org;\n envelope-from=linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n receiver=patchwork.ozlabs.org)"
        ],
        "Received": [
            "from bombadil.infradead.org (bombadil.infradead.org\n [IPv6:2607:7c80:54:3::133])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g49H22CvMz1yJX\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 28 Apr 2026 03:17:18 +1000 (AEST)",
            "from localhost ([::1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1wHPa8-0000000HQQr-2dKu;\n\tMon, 27 Apr 2026 17:17:16 +0000",
            "from sea.source.kernel.org ([172.234.252.31])\n\tby bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1wHPa5-0000000HQOC-2FiG;\n\tMon, 27 Apr 2026 17:17:14 +0000",
            "from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])\n\tby sea.source.kernel.org (Postfix) with ESMTP id 12679437DE;\n\tMon, 27 Apr 2026 17:17:13 +0000 (UTC)",
            "by smtp.kernel.org (Postfix) with ESMTPSA id AC974C2BCB5;\n\tMon, 27 Apr 2026 17:16:59 +0000 (UTC)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help\n\t:List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding:\n\tMIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:\n\tReply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From:\n\tResent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner;\n\tbh=BPNbmpE378SDR0albN3uUkse5xd3MAMC7j8Z5wC8tqY=; b=O/l/pf98DmjOLuoeAAy8HH5hq3\n\thUSPefoklefv2nD1qt1LPeQCiivK9q8viUwIaRpm22j3gBJIyzy1IwhZboTTUXiijm8GSappn2Qjt\n\tjMn4EEZfLtaWV7KYpKoJ3y51OD92Ev1km9wYkmGEsNw2L2Bvl1XKvw5Td6+nYa3dpt+YCvh27QsfW\n\tKxfrTgXABtpEtRRGApvPaaVoLPmrUOiD+jlmMaQG9aHQnWUsvegF0+IAst4qHQNI62NJlmTuuOgyJ\n\tDOr1uNuAqCqsPSeASkPafklZIZp5PyTzOt+v1+UFqXwD3xjNRWx8Vugk3al2dLWfBmbvdte5CcMYd\n\tWu34BQIw==;",
            "v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=k20201202; t=1777310232;\n\tbh=745VKRe61Lf8afs4o89V2mPmcfGcqMzEwAyCkwUFzR4=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=ccnzw+capg6i/qeCJEEZZnJkaeh2P8NEABjGdQ84B8/8ElHQuhaIfwHK4KyIZjuzW\n\t fShA2udW2NQ0Ct7kJfcn/Kb043ljqkq7hTjPsRqwiNPGH9FmgvMogRNjEATWGrG26g\n\t 6zW5qtX0OAMj+t+S60HkjDsyGYMrisyc3m/7o9VPvVvQnsaPOrT5y+ZTzyh8Xto7fx\n\t AWFGU9d3c0Mo3tNoddRUR02dQmZ5LMWSNNkmTWtszo39IueJ4zsAp4+3T5NcIhGntz\n\t oVxgjUbjxhRTuJF8KweLMZaWvhi+rfu1/RR3XrUIQOPEazAae4t8SpoXJ0czDjJbhT\n\t 7qOjNG8l7cqnA=="
        ],
        "From": "\"Christophe Leroy (CS GROUP)\" <chleroy@kernel.org>",
        "To": "Yury Norov <ynorov@nvidia.com>,\n\tAndrew Morton <akpm@linux-foundation.org>,\n\tLinus Torvalds <torvalds@linux-foundation.org>,\n\tDavid Laight <david.laight.linux@gmail.com>,\n\tThomas Gleixner <tglx@linutronix.de>",
        "Cc": "\"Christophe Leroy (CS GROUP)\" <chleroy@kernel.org>,\n\tlinux-alpha@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org,\n\tlinux-snps-arc@lists.infradead.org,\n\tlinux-arm-kernel@lists.infradead.org,\n\tlinux-mips@vger.kernel.org,\n\tlinuxppc-dev@lists.ozlabs.org,\n\tkvm@vger.kernel.org,\n\tlinux-riscv@lists.infradead.org,\n\tlinux-s390@vger.kernel.org,\n\tsparclinux@vger.kernel.org,\n\tlinux-um@lists.infradead.org,\n\tdmaengine@vger.kernel.org,\n\tlinux-efi@vger.kernel.org,\n\tlinux-fsi@lists.ozlabs.org,\n\tamd-gfx@lists.freedesktop.org,\n\tdri-devel@lists.freedesktop.org,\n\tintel-gfx@lists.freedesktop.org,\n\tlinux-wpan@vger.kernel.org,\n\tnetdev@vger.kernel.org,\n\tlinux-wireless@vger.kernel.org,\n\tlinux-spi@vger.kernel.org,\n\tlinux-media@vger.kernel.org,\n\tlinux-staging@lists.linux.dev,\n\tlinux-serial@vger.kernel.org,\n\tlinux-usb@vger.kernel.org,\n\txen-devel@lists.xenproject.org,\n\tlinux-fsdevel@vger.kernel.org,\n\tocfs2-devel@lists.linux.dev,\n\tbpf@vger.kernel.org,\n\tkasan-dev@googlegroups.com,\n\tlinux-mm@kvack.org,\n\tlinux-x25@vger.kernel.org,\n\trust-for-linux@vger.kernel.org,\n\tlinux-sound@vger.kernel.org,\n\tsound-open-firmware@alsa-project.org,\n\tlinux-csky@vger.kernel.org,\n\tlinux-hexagon@vger.kernel.org,\n\tloongarch@lists.linux.dev,\n\tlinux-m68k@lists.linux-m68k.org,\n\tlinux-openrisc@vger.kernel.org,\n\tlinux-parisc@vger.kernel.org,\n\tlinux-sh@vger.kernel.org,\n\tlinux-arch@vger.kernel.org",
        "Subject": "[RFC PATCH v1 1/9] uaccess: Split check_zeroed_user() out of\n usercopy.c",
        "Date": "Mon, 27 Apr 2026 19:13:42 +0200",
        "Message-ID": "\n <a6d39afb167871e0459946dfd6b28bc994ae3c81.1777306795.git.chleroy@kernel.org>",
        "X-Mailer": "git-send-email 2.49.0",
        "In-Reply-To": "<cover.1777306795.git.chleroy@kernel.org>",
        "References": "<cover.1777306795.git.chleroy@kernel.org>",
        "MIME-Version": "1.0",
        "X-Developer-Signature": "v=1; a=openpgp-sha256; l=4389; i=chleroy@kernel.org;\n h=from:subject:message-id; bh=745VKRe61Lf8afs4o89V2mPmcfGcqMzEwAyCkwUFzR4=;\n b=owGbwMvMwCV2d0KB2p7V54MZT6slMWS+nxmtvkzq83WmyICs092/GNmylHyYwx1uy/R0rjqso\n Tc19NiJjlIWBjEuBlkxRZbj/7l3zej6kpo/dZc+zBxWJpAhDFycAjCRrBxGhr1T21lnr9ow8bLw\n mlcX9LlDfR53LmTbs/fCv2dGAh23RTkY/gpGWFpU+sbMuNm2suHwI9OT2xZsfrLc1dbD4+idxHd\n 72DkA",
        "X-Developer-Key": "i=chleroy@kernel.org; a=openpgp;\n fpr=10FFE6F8B390DE17ACC2632368A92FEB01B8DD78",
        "Content-Transfer-Encoding": "8bit",
        "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ",
        "X-CRM114-CacheID": "sfid-20260427_101713_623666_383C1FCF ",
        "X-CRM114-Status": "GOOD (  12.56  )",
        "X-Spam-Score": "-2.1 (--)",
        "X-Spam-Report": "Spam detection software,\n running on the system \"bombadil.infradead.org\",\n has NOT identified this incoming email as spam.  The original\n message has been attached to this so you can view it or label\n similar future email.  If you have any questions, see\n the administrator of that system for details.\n Content preview:  Until commit f5a1a536fa14 (\"lib: introduce\n copy_struct_from_user()\n    helper\"), lib/usercopy.c was containing only the out-line version of user\n    copy fonctions. That commit added function check_zeroed_user() into the\n same\n    file. Move that function into a new file named usercheck.c, so that next\n   patch can change usercopy.c build to a conditional build.\n Content analysis details:   (-2.1 points, 5.0 required)\n  pts rule name              description\n ---- ----------------------\n --------------------------------------------------\n -0.0 SPF_PASS               SPF: sender matches SPF record\n  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record\n -0.1 DKIM_VALID_EF          Message has a valid DKIM or DK signature from\n                             envelope-from domain\n -0.1 DKIM_VALID_AU          Message has a valid DKIM or DK signature from\n author's\n                             domain\n -0.1 DKIM_VALID             Message has at least one valid DKIM or DK\n signature\n  0.1 DKIM_SIGNED            Message has a DKIM or DK signature,\n not necessarily valid\n -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n                             [score: 0.0000]\n -0.0 DKIMWL_WL_HIGH         DKIMwl.org - High trust sender",
        "X-BeenThere": "linux-um@lists.infradead.org",
        "X-Mailman-Version": "2.1.34",
        "Precedence": "list",
        "List-Id": "<linux-um.lists.infradead.org>",
        "List-Unsubscribe": "<http://lists.infradead.org/mailman/options/linux-um>,\n <mailto:linux-um-request@lists.infradead.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.infradead.org/pipermail/linux-um/>",
        "List-Post": "<mailto:linux-um@lists.infradead.org>",
        "List-Help": "<mailto:linux-um-request@lists.infradead.org?subject=help>",
        "List-Subscribe": "<http://lists.infradead.org/mailman/listinfo/linux-um>,\n <mailto:linux-um-request@lists.infradead.org?subject=subscribe>",
        "Sender": "\"linux-um\" <linux-um-bounces@lists.infradead.org>",
        "Errors-To": "linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org"
    },
    "content": "Until commit f5a1a536fa14 (\"lib: introduce copy_struct_from_user()\nhelper\"), lib/usercopy.c was containing only the out-line version\nof user copy fonctions.\n\nThat commit added function check_zeroed_user() into the same file.\nMove that function into a new file named usercheck.c, so that next\npatch can change usercopy.c build to a conditional build.\n\nSigned-off-by: Christophe Leroy (CS GROUP) <chleroy@kernel.org>\n---\n lib/Makefile                    |  1 +\n lib/{usercopy.c => usercheck.c} | 22 ------------\n lib/usercopy.c                  | 62 ---------------------------------\n 3 files changed, 1 insertion(+), 84 deletions(-)\n copy lib/{usercopy.c => usercheck.c} (73%)",
    "diff": "diff --git a/lib/Makefile b/lib/Makefile\nindex f33a24bf1c19..7c0334d7675b 100644\n--- a/lib/Makefile\n+++ b/lib/Makefile\n@@ -59,6 +59,7 @@ obj-y += bcd.o sort.o parser.o debug_locks.o random32.o \\\n \t percpu-refcount.o rhashtable.o base64.o \\\n \t once.o refcount.o rcuref.o usercopy.o errseq.o bucket_locks.o \\\n \t generic-radix-tree.o bitmap-str.o\n+obj-y += usercheck.o\n obj-y += string_helpers.o\n obj-y += hexdump.o\n obj-$(CONFIG_TEST_HEXDUMP) += test_hexdump.o\ndiff --git a/lib/usercopy.c b/lib/usercheck.c\nsimilarity index 73%\ncopy from lib/usercopy.c\ncopy to lib/usercheck.c\nindex b00a3a957de6..15b0d9a18435 100644\n--- a/lib/usercopy.c\n+++ b/lib/usercheck.c\n@@ -2,32 +2,10 @@\n #include <linux/compiler.h>\n #include <linux/errno.h>\n #include <linux/export.h>\n-#include <linux/fault-inject-usercopy.h>\n-#include <linux/instrumented.h>\n #include <linux/kernel.h>\n-#include <linux/nospec.h>\n-#include <linux/string.h>\n #include <linux/uaccess.h>\n #include <linux/wordpart.h>\n \n-/* out-of-line parts */\n-\n-#if !defined(INLINE_COPY_FROM_USER)\n-unsigned long _copy_from_user(void *to, const void __user *from, unsigned long n)\n-{\n-\treturn _inline_copy_from_user(to, from, n);\n-}\n-EXPORT_SYMBOL(_copy_from_user);\n-#endif\n-\n-#if !defined(INLINE_COPY_TO_USER)\n-unsigned long _copy_to_user(void __user *to, const void *from, unsigned long n)\n-{\n-\treturn _inline_copy_to_user(to, from, n);\n-}\n-EXPORT_SYMBOL(_copy_to_user);\n-#endif\n-\n /**\n  * check_zeroed_user: check if a userspace buffer only contains zero bytes\n  * @from: Source address, in userspace.\ndiff --git a/lib/usercopy.c b/lib/usercopy.c\nindex b00a3a957de6..7a93f56d81dd 100644\n--- a/lib/usercopy.c\n+++ b/lib/usercopy.c\n@@ -1,14 +1,6 @@\n // SPDX-License-Identifier: GPL-2.0\n-#include <linux/compiler.h>\n-#include <linux/errno.h>\n #include <linux/export.h>\n-#include <linux/fault-inject-usercopy.h>\n-#include <linux/instrumented.h>\n-#include <linux/kernel.h>\n-#include <linux/nospec.h>\n-#include <linux/string.h>\n #include <linux/uaccess.h>\n-#include <linux/wordpart.h>\n \n /* out-of-line parts */\n \n@@ -27,57 +19,3 @@ unsigned long _copy_to_user(void __user *to, const void *from, unsigned long n)\n }\n EXPORT_SYMBOL(_copy_to_user);\n #endif\n-\n-/**\n- * check_zeroed_user: check if a userspace buffer only contains zero bytes\n- * @from: Source address, in userspace.\n- * @size: Size of buffer.\n- *\n- * This is effectively shorthand for \"memchr_inv(from, 0, size) == NULL\" for\n- * userspace addresses (and is more efficient because we don't care where the\n- * first non-zero byte is).\n- *\n- * Returns:\n- *  * 0: There were non-zero bytes present in the buffer.\n- *  * 1: The buffer was full of zero bytes.\n- *  * -EFAULT: access to userspace failed.\n- */\n-int check_zeroed_user(const void __user *from, size_t size)\n-{\n-\tunsigned long val;\n-\tuintptr_t align = (uintptr_t) from % sizeof(unsigned long);\n-\n-\tif (unlikely(size == 0))\n-\t\treturn 1;\n-\n-\tfrom -= align;\n-\tsize += align;\n-\n-\tif (!user_read_access_begin(from, size))\n-\t\treturn -EFAULT;\n-\n-\tunsafe_get_user(val, (unsigned long __user *) from, err_fault);\n-\tif (align)\n-\t\tval &= ~aligned_byte_mask(align);\n-\n-\twhile (size > sizeof(unsigned long)) {\n-\t\tif (unlikely(val))\n-\t\t\tgoto done;\n-\n-\t\tfrom += sizeof(unsigned long);\n-\t\tsize -= sizeof(unsigned long);\n-\n-\t\tunsafe_get_user(val, (unsigned long __user *) from, err_fault);\n-\t}\n-\n-\tif (size < sizeof(unsigned long))\n-\t\tval &= aligned_byte_mask(size);\n-\n-done:\n-\tuser_read_access_end();\n-\treturn (val == 0);\n-err_fault:\n-\tuser_read_access_end();\n-\treturn -EFAULT;\n-}\n-EXPORT_SYMBOL(check_zeroed_user);\n",
    "prefixes": [
        "RFC",
        "v1",
        "1/9"
    ]
}