get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2231267,
    "url": "http://patchwork.ozlabs.org/api/patches/2231267/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/ubuntu-kernel/patch/64d1ec09dd1fe00d229fcd6146e59c32683cf3f0.1777552173.git.massimiliano.pellizzer@canonical.com/",
    "project": {
        "id": 15,
        "url": "http://patchwork.ozlabs.org/api/projects/15/?format=api",
        "name": "Ubuntu Kernel",
        "link_name": "ubuntu-kernel",
        "list_id": "kernel-team.lists.ubuntu.com",
        "list_email": "kernel-team@lists.ubuntu.com",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<64d1ec09dd1fe00d229fcd6146e59c32683cf3f0.1777552173.git.massimiliano.pellizzer@canonical.com>",
    "list_archive_url": null,
    "date": "2026-04-30T12:30:29",
    "name": "[SRU,J,1/9] crypto: scatterwalk - Backport memcpy_sglist()",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "3e4d1875cdf7437bf8572155e379d6ab6becadd1",
    "submitter": {
        "id": 89057,
        "url": "http://patchwork.ozlabs.org/api/people/89057/?format=api",
        "name": "Massimiliano Pellizzer",
        "email": "massimiliano.pellizzer@canonical.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/ubuntu-kernel/patch/64d1ec09dd1fe00d229fcd6146e59c32683cf3f0.1777552173.git.massimiliano.pellizzer@canonical.com/mbox/",
    "series": [
        {
            "id": 502300,
            "url": "http://patchwork.ozlabs.org/api/series/502300/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/ubuntu-kernel/list/?series=502300",
            "date": "2026-04-30T12:30:28",
            "name": "CVE-2026-31431",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/502300/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2231267/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2231267/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<kernel-team-bounces@lists.ubuntu.com>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (4096-bit key;\n unprotected) header.d=canonical.com header.i=@canonical.com\n header.a=rsa-sha256 header.s=20251003 header.b=XQe8WU9B;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com\n (client-ip=185.125.189.65; helo=lists.ubuntu.com;\n envelope-from=kernel-team-bounces@lists.ubuntu.com;\n receiver=patchwork.ozlabs.org)"
        ],
        "Received": [
            "from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g5tpT1GVlz1yGq\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 30 Apr 2026 22:32:01 +1000 (AEST)",
            "from localhost ([127.0.0.1] helo=lists.ubuntu.com)\n\tby lists.ubuntu.com with esmtp (Exim 4.86_2)\n\t(envelope-from <kernel-team-bounces@lists.ubuntu.com>)\n\tid 1wIQYZ-00061o-ER; Thu, 30 Apr 2026 12:31:51 +0000",
            "from smtp-relay-internal-1.internal ([10.131.114.114]\n helo=smtp-relay-internal-1.canonical.com)\n by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.86_2) (envelope-from <massimiliano.pellizzer@canonical.com>)\n id 1wIQYG-0004td-RS\n for kernel-team@lists.ubuntu.com; Thu, 30 Apr 2026 12:31:32 +0000",
            "from mail-wm1-f72.google.com (mail-wm1-f72.google.com\n [209.85.128.72])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 928D23F9CB\n for <kernel-team@lists.ubuntu.com>; Thu, 30 Apr 2026 12:31:32 +0000 (UTC)",
            "by mail-wm1-f72.google.com with SMTP id\n 5b1f17b1804b1-488d56f87e8so7290535e9.0\n for <kernel-team@lists.ubuntu.com>; Thu, 30 Apr 2026 05:31:32 -0700 (PDT)",
            "from tuxedo-infinitybook.ts.net\n (net-93-71-66-38.cust.vodafonedsl.it. [93.71.66.38])\n by smtp.gmail.com with ESMTPSA id\n 5b1f17b1804b1-48a81ed6bafsm103695005e9.2.2026.04.30.05.31.29\n for <kernel-team@lists.ubuntu.com>\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 30 Apr 2026 05:31:29 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com;\n s=20251003; t=1777552292;\n bh=Xx2lTU8w4P8RwdZPm3wkbSDvEkDa5eFsn+AdabNSknM=;\n h=From:To:Subject:Date:Message-ID:In-Reply-To:References:\n MIME-Version;\n b=XQe8WU9BUWZc4VFogDj4Ww/zHj4yRQUyFYUIOyGIC1Ukp6CqKW4F0KpRO3CpngxZl\n 7P7AX2evXbRvfp/yTT08h1bjUkX7X9z2bYfGAXHQ1vCqkkwpD/K8wlF8x3BLsxfXRa\n 5SHBWBDnYMRumhvx33EueNVYv7kJQryXrSrtr9mTSDASBYcbtppsoVaSaKROYzmqpF\n QVty+2MZcj3a5V8k01a/AoNXpTUWecyA4mhd7hyVg+oS+6F5iIxXQaxgGPxJw0wg6b\n dcv0/PlyjN9hCmlRVPHS/b7kg8irCnmwEz/ilvn2XOQJs+O/RyO0zUMeW/4WBaOasv\n WcYUxtBtVXZGfuvKXBL7sAdmGTknF5gw5DAZrGtHQeVmsdfwF3LPD9JHAsW/UW8m/i\n 3baA/0gPyhxPvq5iIvtrpNw3T9ibb219SxYGcERQDnM4h+0yHnMwXwoDiInKcukD4P\n dsOet4kTC3bMKck4kXG5L6Awa7N78rqXBsHW1Wfa5+sGCUKVnkZ6NmwHMznxxYghOm\n GfmjjvVeo8EcO3DBH/WvnXjTapJON9eEEJ2+OcqUoyOH0tGougv6QaFcj+HQKiATSU\n 7zfxu7uGLdGdvg9uFan/ihRaAjGE/gGRjATRANB7On629xi+suKhAZBzogto6OrjI1\n LQawLc6qbo5YLF3oKtTaltyY=",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1777552291; x=1778157091;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to\n :cc:subject:date:message-id:reply-to;\n bh=Xx2lTU8w4P8RwdZPm3wkbSDvEkDa5eFsn+AdabNSknM=;\n b=nJybOd844e1aVe5krQKFnVSpNbsCMZ7em20XvEn2SX014FudrMeVnHqlh47HIza5i7\n nSQGHbSdCtWAX5igpyhHkwoAee4DRZ5WLrSq6E27e8ehsSDIMQvignv+3Fd1kubEiyU+\n zKcgU4UZDzl/zeXaPgRNLOdjQw8cG8KuoeuiJ7qPfU1Y18+nd7F1fJVct8rc44DNFaaI\n wfgSWT29YAhaQMREL+LzkgTcP/cUxqyEp3bHJhRoCeFm9ZNfWH/9cgfv6zXVMfQ65Qk+\n n0gS3GKW6CHjN94Z9VGqGA0gTHbJkDuZumWplFt+7ZFOWZ7x7gsvg3QD/mxqJDN2enwI\n hWsQ==",
        "X-Gm-Message-State": "AOJu0Yz8JjzckVlST4fjkOHwZrUORdG+tkfruML8Czr+7TFztmbyku2h\n B0AFpRgtpYckEp/pQiSfaHoobWmL3PoUSApENAIdSgqomKJc23Vn82FYYdM5ZLR6NgD8cpmTmZJ\n DML5fa0gwgvVKoCLU6MitqlN39oCymRuKXjQcfkSt+uZ/9EX1HKPFFmcNWUAjl2UpDCfGFTzfzq\n 9z3mXkJ+OeHrXShg==",
        "X-Gm-Gg": "AeBDieuZm11i7bnnnAOZ5Y8MDmp48vEsvXzOE7Ze+hvBPznRz9qrNcCdlciehoEXfOl\n jKWaAHwPXJzRkZt0onWWPvpxekf+f4tg/uSPaco925Suv/bLNHwfHnGLFiTmKDHMqIj+4Yhq28T\n yjIL3h7dMRML6ZiqfYvliAoF3HFtB+QDA9PmTJSwlQCsIWgmxOKd+0eh0z0sl7tiClV4ysf0mob\n lvDV2TRRnL87DMdhcyepGr1fwk9A+z2BCxuc918Pnu1ah2XSRDy5zXYFDZiqYgAfiD6McJV5gtO\n oo6eXTGOpH/UbUcIBZaD2WTfseE3s/53JuWlcm5ltcjc66GuPTN1ayR5HsIaQO1rHBiReb1yAP0\n jZCZB4zt/KXO6PSx/fg+QvQwqXKypvLf+7s+ua46OEZBMP/R87IHo84Z9blvT8QrEb0gIEFrVbk\n ibznIyOAQatnFqCLBc4ZepCjG2pVcW8ohnN0eResbyfrwGbwpfATVHZxCYQY8s5zgcZQ5jPVap+\n 1pu8EJB8xhi43xZ+HtxYZY=",
        "X-Received": [
            "by 2002:a05:600c:548d:b0:487:21c7:2885 with SMTP id\n 5b1f17b1804b1-48a83f6c90fmr43950655e9.5.1777552291077;\n Thu, 30 Apr 2026 05:31:31 -0700 (PDT)",
            "by 2002:a05:600c:548d:b0:487:21c7:2885 with SMTP id\n 5b1f17b1804b1-48a83f6c90fmr43950065e9.5.1777552290404;\n Thu, 30 Apr 2026 05:31:30 -0700 (PDT)"
        ],
        "From": "Massimiliano Pellizzer <massimiliano.pellizzer@canonical.com>",
        "To": "kernel-team@lists.ubuntu.com",
        "Subject": "[SRU][J][PATCH 1/9] crypto: scatterwalk - Backport memcpy_sglist()",
        "Date": "Thu, 30 Apr 2026 14:30:29 +0200",
        "Message-ID": "\n <64d1ec09dd1fe00d229fcd6146e59c32683cf3f0.1777552173.git.massimiliano.pellizzer@canonical.com>",
        "X-Mailer": "git-send-email 2.53.0",
        "In-Reply-To": "<cover.1777552173.git.massimiliano.pellizzer@canonical.com>",
        "References": "\n <177754965576.503496.12142658280614619991@tuxedo-infinitybook.public>\n <cover.1777552173.git.massimiliano.pellizzer@canonical.com>",
        "MIME-Version": "1.0",
        "X-BeenThere": "kernel-team@lists.ubuntu.com",
        "X-Mailman-Version": "2.1.20",
        "Precedence": "list",
        "List-Id": "Kernel team discussions <kernel-team.lists.ubuntu.com>",
        "List-Unsubscribe": "<https://lists.ubuntu.com/mailman/options/kernel-team>,\n <mailto:kernel-team-request@lists.ubuntu.com?subject=unsubscribe>",
        "List-Archive": "<https://lists.ubuntu.com/archives/kernel-team>",
        "List-Post": "<mailto:kernel-team@lists.ubuntu.com>",
        "List-Help": "<mailto:kernel-team-request@lists.ubuntu.com?subject=help>",
        "List-Subscribe": "<https://lists.ubuntu.com/mailman/listinfo/kernel-team>,\n <mailto:kernel-team-request@lists.ubuntu.com?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "base64",
        "Errors-To": "kernel-team-bounces@lists.ubuntu.com",
        "Sender": "\"kernel-team\" <kernel-team-bounces@lists.ubuntu.com>"
    },
    "content": "From: Eric Biggers <ebiggers@kernel.org>\n\nThis backports the current implementation of memcpy_sglist() from\nupstream commit 4dffc9bbffb9ccfcda730d899c97c553599e7ca8.\n\nThis function was rewritten twice.  The earlier implementations had many\nprerequisite commits, while the latest implementation is standalone.\nIt's much easier to just backport the latest code directly.\n\nSigned-off-by: Eric Biggers <ebiggers@kernel.org>\nSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>\n(cherry picked from commit 36435a56cd6bab7609c3e0fd7a70224795375748 linux-5.15.y)\nCVE-2026-31431\nSigned-off-by: Massimiliano Pellizzer <massimiliano.pellizzer@canonical.com>\n---\n crypto/scatterwalk.c         | 94 ++++++++++++++++++++++++++++++++++++\n include/crypto/scatterwalk.h | 32 ++++++++++++\n 2 files changed, 126 insertions(+)",
    "diff": "diff --git a/crypto/scatterwalk.c b/crypto/scatterwalk.c\nindex 16f6ba896fb63..9f0b27005166c 100644\n--- a/crypto/scatterwalk.c\n+++ b/crypto/scatterwalk.c\n@@ -69,6 +69,100 @@ void scatterwalk_map_and_copy(void *buf, struct scatterlist *sg,\n }\n EXPORT_SYMBOL_GPL(scatterwalk_map_and_copy);\n \n+/**\n+ * memcpy_sglist() - Copy data from one scatterlist to another\n+ * @dst: The destination scatterlist.  Can be NULL if @nbytes == 0.\n+ * @src: The source scatterlist.  Can be NULL if @nbytes == 0.\n+ * @nbytes: Number of bytes to copy\n+ *\n+ * The scatterlists can describe exactly the same memory, in which case this\n+ * function is a no-op.  No other overlaps are supported.\n+ *\n+ * Context: Any context\n+ */\n+void memcpy_sglist(struct scatterlist *dst, struct scatterlist *src,\n+\t\t   unsigned int nbytes)\n+{\n+\tunsigned int src_offset, dst_offset;\n+\n+\tif (unlikely(nbytes == 0)) /* in case src and/or dst is NULL */\n+\t\treturn;\n+\n+\tsrc_offset = src->offset;\n+\tdst_offset = dst->offset;\n+\tfor (;;) {\n+\t\t/* Compute the length to copy this step. */\n+\t\tunsigned int len = min3(src->offset + src->length - src_offset,\n+\t\t\t\t\tdst->offset + dst->length - dst_offset,\n+\t\t\t\t\tnbytes);\n+\t\tstruct page *src_page = sg_page(src);\n+\t\tstruct page *dst_page = sg_page(dst);\n+\t\tconst void *src_virt;\n+\t\tvoid *dst_virt;\n+\n+\t\tif (IS_ENABLED(CONFIG_HIGHMEM)) {\n+\t\t\t/* HIGHMEM: we may have to actually map the pages. */\n+\t\t\tconst unsigned int src_oip = offset_in_page(src_offset);\n+\t\t\tconst unsigned int dst_oip = offset_in_page(dst_offset);\n+\t\t\tconst unsigned int limit = PAGE_SIZE;\n+\n+\t\t\t/* Further limit len to not cross a page boundary. */\n+\t\t\tlen = min3(len, limit - src_oip, limit - dst_oip);\n+\n+\t\t\t/* Compute the source and destination pages. */\n+\t\t\tsrc_page += src_offset / PAGE_SIZE;\n+\t\t\tdst_page += dst_offset / PAGE_SIZE;\n+\n+\t\t\tif (src_page != dst_page) {\n+\t\t\t\t/* Copy between different pages. */\n+\t\t\t\tmemcpy_page(dst_page, dst_oip,\n+\t\t\t\t\t    src_page, src_oip, len);\n+\t\t\t\tflush_dcache_page(dst_page);\n+\t\t\t} else if (src_oip != dst_oip) {\n+\t\t\t\t/* Copy between different parts of same page. */\n+\t\t\t\tdst_virt = kmap_local_page(dst_page);\n+\t\t\t\tmemcpy(dst_virt + dst_oip, dst_virt + src_oip,\n+\t\t\t\t       len);\n+\t\t\t\tkunmap_local(dst_virt);\n+\t\t\t\tflush_dcache_page(dst_page);\n+\t\t\t} /* Else, it's the same memory.  No action needed. */\n+\t\t} else {\n+\t\t\t/*\n+\t\t\t * !HIGHMEM: no mapping needed.  Just work in the linear\n+\t\t\t * buffer of each sg entry.  Note that we can cross page\n+\t\t\t * boundaries, as they are not significant in this case.\n+\t\t\t */\n+\t\t\tsrc_virt = page_address(src_page) + src_offset;\n+\t\t\tdst_virt = page_address(dst_page) + dst_offset;\n+\t\t\tif (src_virt != dst_virt) {\n+\t\t\t\tmemcpy(dst_virt, src_virt, len);\n+\t\t\t\tif (ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE)\n+\t\t\t\t\t__scatterwalk_flush_dcache_pages(\n+\t\t\t\t\t\tdst_page, dst_offset, len);\n+\t\t\t} /* Else, it's the same memory.  No action needed. */\n+\t\t}\n+\t\tnbytes -= len;\n+\t\tif (nbytes == 0) /* No more to copy? */\n+\t\t\tbreak;\n+\n+\t\t/*\n+\t\t * There's more to copy.  Advance the offsets by the length\n+\t\t * copied this step, and advance the sg entries as needed.\n+\t\t */\n+\t\tsrc_offset += len;\n+\t\tif (src_offset >= src->offset + src->length) {\n+\t\t\tsrc = sg_next(src);\n+\t\t\tsrc_offset = src->offset;\n+\t\t}\n+\t\tdst_offset += len;\n+\t\tif (dst_offset >= dst->offset + dst->length) {\n+\t\t\tdst = sg_next(dst);\n+\t\t\tdst_offset = dst->offset;\n+\t\t}\n+\t}\n+}\n+EXPORT_SYMBOL_GPL(memcpy_sglist);\n+\n struct scatterlist *scatterwalk_ffwd(struct scatterlist dst[2],\n \t\t\t\t     struct scatterlist *src,\n \t\t\t\t     unsigned int len)\ndiff --git a/include/crypto/scatterwalk.h b/include/crypto/scatterwalk.h\nindex 7af08174a7212..df9c1ba3bd5cb 100644\n--- a/include/crypto/scatterwalk.h\n+++ b/include/crypto/scatterwalk.h\n@@ -88,6 +88,35 @@ static inline void scatterwalk_pagedone(struct scatter_walk *walk, int out,\n \t\tscatterwalk_start(walk, sg_next(walk->sg));\n }\n \n+/*\n+ * Flush the dcache of any pages that overlap the region\n+ * [offset, offset + nbytes) relative to base_page.\n+ *\n+ * This should be called only when ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE, to ensure\n+ * that all relevant code (including the call to sg_page() in the caller, if\n+ * applicable) gets fully optimized out when !ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE.\n+ */\n+static inline void __scatterwalk_flush_dcache_pages(struct page *base_page,\n+\t\t\t\t\t\t    unsigned int offset,\n+\t\t\t\t\t\t    unsigned int nbytes)\n+{\n+\tunsigned int num_pages;\n+\tunsigned int i;\n+\n+\tbase_page += offset / PAGE_SIZE;\n+\toffset %= PAGE_SIZE;\n+\n+\t/*\n+\t * This is an overflow-safe version of\n+\t * num_pages = DIV_ROUND_UP(offset + nbytes, PAGE_SIZE).\n+\t */\n+\tnum_pages = nbytes / PAGE_SIZE;\n+\tnum_pages += DIV_ROUND_UP(offset + (nbytes % PAGE_SIZE), PAGE_SIZE);\n+\n+\tfor (i = 0; i < num_pages; i++)\n+\t\tflush_dcache_page(base_page + i);\n+}\n+\n static inline void scatterwalk_done(struct scatter_walk *walk, int out,\n \t\t\t\t    int more)\n {\n@@ -100,6 +129,9 @@ void scatterwalk_copychunks(void *buf, struct scatter_walk *walk,\n \t\t\t    size_t nbytes, int out);\n void *scatterwalk_map(struct scatter_walk *walk);\n \n+void memcpy_sglist(struct scatterlist *dst, struct scatterlist *src,\n+\t\t   unsigned int nbytes);\n+\n void scatterwalk_map_and_copy(void *buf, struct scatterlist *sg,\n \t\t\t      unsigned int start, unsigned int nbytes, int out);\n \n",
    "prefixes": [
        "SRU",
        "J",
        "1/9"
    ]
}