get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2231265,
    "url": "http://patchwork.ozlabs.org/api/patches/2231265/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/ubuntu-kernel/patch/5a4fa6693d52f6e4659f94052915796e02b8a675.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": "<5a4fa6693d52f6e4659f94052915796e02b8a675.1777552173.git.massimiliano.pellizzer@canonical.com>",
    "list_archive_url": null,
    "date": "2026-04-30T12:30:31",
    "name": "[SRU,J,3/9] crypto: algif_aead - Revert to operating out-of-place",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "15dffe1fb6f44b8574b71608ccc28446e10e7abd",
    "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/5a4fa6693d52f6e4659f94052915796e02b8a675.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/2231265/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2231265/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=eoAGozr0;\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 4g5tpL3dJlz1yGq\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 30 Apr 2026 22:31:54 +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 1wIQYR-0005YA-J3; Thu, 30 Apr 2026 12:31:43 +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 1wIQYJ-0004zv-Pn\n for kernel-team@lists.ubuntu.com; Thu, 30 Apr 2026 12:31:35 +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 7BEBB3F9CB\n for <kernel-team@lists.ubuntu.com>; Thu, 30 Apr 2026 12:31:34 +0000 (UTC)",
            "by mail-wm1-f72.google.com with SMTP id\n 5b1f17b1804b1-488dcaf2f2fso6953035e9.0\n for <kernel-team@lists.ubuntu.com>; Thu, 30 Apr 2026 05:31:34 -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.31\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:31 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com;\n s=20251003; t=1777552294;\n bh=vZKh0ig+WaQjg0L4MKyrpsyvAAiu1vleXi1Uc7z61Zs=;\n h=From:To:Subject:Date:Message-ID:In-Reply-To:References:\n MIME-Version;\n b=eoAGozr0hN376kIFllsACZJHizPqvQBnUE+zM/mOnlQTtQ5hCwb6dy7OQTca9i5pY\n 2Vr3dZPYCVPJ5N8P1xjrBCgPKe2pLelTgbH5HWavAMZLUuzbr+hq2L2jS16ltWQKzQ\n XLkKzSVDZ361cJ99Tw10dEXYOQCqCIDkuAkWku/boZ9rbLFaTbt6WohH3rOSNwgNlF\n amUMFrnCknG0Ck1/tAL4wJGZ2K/sfwbKf5QTq5RPZbq2Rg7plj9/w6ubRhHnnVGnti\n prCUtkCFKqx5Cl7t3uhdiKkGb/cWJJgw0JVhZhQUweVI0nlI5EZbWqT7cm9OXc9edg\n I3wj67O9GOoNOLGPh17PhUbctBEdGdb3XPIzCExpvW8aUNTRPZkg83htB4/LCtymvs\n sV3MYr7r+y9yaZqptlfN4fy67r81/0wRLUGBldf6L3TDjbfi+us/R4gJgVxF3Pi4HR\n bmWIN1QTo/7Bq8lfPasRPi+PHic1dt+bVgtJgg88PEy3yapVTcanm8u9f9044zcyuI\n IzM33V7jeOyXYFVjNnSSgauCTPk+GsCKcylaAaH29LvsQrJLJVZKu7r/xsCqJRTUW/\n WSo+WGX2VPo9fJ7UIZub+roARXfvj1/VpU3QbAvvxHzSQXa9/mUIV2qNFv0IL1mzhJ\n 48dTlQU9MVJmx7zraxpN2Ezk=",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1777552294; x=1778157094;\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=vZKh0ig+WaQjg0L4MKyrpsyvAAiu1vleXi1Uc7z61Zs=;\n b=H6BoH0vkShUOtIhihARyHP6mH7PmU4yiE53PYoJ+42Ya0yziX9ECzpEe2LZmMqMPux\n 8Zff6NOe+vsYx0lsffCxIa1//mFN0BxBECiyzyQfJv5GP0NFuaY966BblQhQt7gNVxod\n FzNnDZbm5MmDs5V8El6UGFfRB1VgETq/Q2u2HM9xj9FRTw8pHkQ7pR/21XtN2/8L04Vb\n Sy+TVN9EKqXWukeAdH2QiCg5vPw6mmMLi4AMRFJpctlk/HSAjEKj8phmtXU2xZvzXmlU\n +LnS7YMd2fif8X5KCkdTWxnMeRbsiOuyxuBit2zqUi7AYR2xfAOq1bAYuzDmYg/L4N9j\n bqIQ==",
        "X-Gm-Message-State": "AOJu0Ywfl7qKonDiA/z93nT57h1t9qzKot/KapA/6xTP2BlVboDfxLtw\n GklneGfw2s35JLi8yvh6HqkjP2sNyEtv0NAGSoaugtqP/P6HDhR+WQcGhN5yKADhf7WJAvX1nob\n lVJ/qVCeWv/uzTH4550JBfwCQi4KbpyE7nAADjM6QMEdbwe8U9QlDaY8svh8Lm8/87zUqUxdq1a\n AyA875iDv19zV2Ng==",
        "X-Gm-Gg": "AeBDies6ixFqYJNV9+1i3qRoUEdZHC7sLkgiSa9pQ3MpikECvyYWj9rGU+OtfO5LV5v\n J3Zn4+QRlACEbhSpUyggHgHnTjRA7/ZmJoDrqjb8G456JdOeBNrslCAu0g30Gn7RN7Ci9f2wOQF\n 4fuxJajfs+XqAbblF+7NPINPoEqUL5W5ofBFyPVXjQDArHX83RfKSD4fBD+zZR16KE7O3MP0lKr\n bee7gHk4xe+NPbT1HTlAdoQuHH9+HEckjez43egJZxUcKX3AFio/dh17LW0thGoelmlMORtZQBD\n WgZUqbgOt8ze7QPw5t23NVju2owgkVtC4Sk6cnn0tfyW85VpAFgGXJQRGufGc2o4yOsFt6Nyzcf\n Z61+oe+jlKmSKkNoFUHgv3wZxKp6qytP4FmurGlGF2eh6qH5geStur8BUtnxlBltaYuBTeTVdNG\n 8CGf8nsNhdQbVVXQiivdP/XZcoVchl1NZ/xL3pXmlCmbynxOaD/3l1Tj1ZYUabUsSRuFj71kN5H\n 6U91bMMOCekvJq6RsgL0hk=",
        "X-Received": [
            "by 2002:a05:600c:4e88:b0:485:7f02:afd5 with SMTP id\n 5b1f17b1804b1-48a84444083mr44247935e9.13.1777552293642;\n Thu, 30 Apr 2026 05:31:33 -0700 (PDT)",
            "by 2002:a05:600c:4e88:b0:485:7f02:afd5 with SMTP id\n 5b1f17b1804b1-48a84444083mr44247215e9.13.1777552292917;\n Thu, 30 Apr 2026 05:31:32 -0700 (PDT)"
        ],
        "From": "Massimiliano Pellizzer <massimiliano.pellizzer@canonical.com>",
        "To": "kernel-team@lists.ubuntu.com",
        "Subject": "[SRU][J][PATCH 3/9] crypto: algif_aead - Revert to operating\n out-of-place",
        "Date": "Thu, 30 Apr 2026 14:30:31 +0200",
        "Message-ID": "\n <5a4fa6693d52f6e4659f94052915796e02b8a675.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: Herbert Xu <herbert@gondor.apana.org.au>\n\ncommit a664bf3d603dc3bdcf9ae47cc21e0daec706d7a5 upstream.\n\nThis mostly reverts commit 72548b093ee3 except for the copying of\nthe associated data.\n\nThere is no benefit in operating in-place in algif_aead since the\nsource and destination come from different mappings.  Get rid of\nall the complexity added for in-place operation and just copy the\nAD directly.\n\nFixes: 72548b093ee3 (\"crypto: algif_aead - copy AAD from src to dst\")\nReported-by: Taeyang Lee <0wn@theori.io>\nSigned-off-by: Herbert Xu <herbert@gondor.apana.org.au>\nSigned-off-by: Eric Biggers <ebiggers@kernel.org>\nSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>\n(cherry picked from commit 19d43105a97be0810edbda875f2cd03f30dc130c linux-5.15.y)\nCVE-2026-31431\nSigned-off-by: Massimiliano Pellizzer <massimiliano.pellizzer@canonical.com>\n---\n crypto/af_alg.c         | 49 +++++---------------\n crypto/algif_aead.c     | 99 ++++++++---------------------------------\n crypto/algif_skcipher.c |  6 +--\n include/crypto/if_alg.h |  5 +--\n 4 files changed, 34 insertions(+), 125 deletions(-)",
    "diff": "diff --git a/crypto/af_alg.c b/crypto/af_alg.c\nindex 658d5c3c88b7b..adc50991a6d75 100644\n--- a/crypto/af_alg.c\n+++ b/crypto/af_alg.c\n@@ -527,15 +527,13 @@ static int af_alg_alloc_tsgl(struct sock *sk)\n /**\n  * af_alg_count_tsgl - Count number of TX SG entries\n  *\n- * The counting starts from the beginning of the SGL to @bytes. If\n- * an @offset is provided, the counting of the SG entries starts at the @offset.\n+ * The counting starts from the beginning of the SGL to @bytes.\n  *\n  * @sk: socket of connection to user space\n  * @bytes: Count the number of SG entries holding given number of bytes.\n- * @offset: Start the counting of SG entries from the given offset.\n  * Return: Number of TX SG entries found given the constraints\n  */\n-unsigned int af_alg_count_tsgl(struct sock *sk, size_t bytes, size_t offset)\n+unsigned int af_alg_count_tsgl(struct sock *sk, size_t bytes)\n {\n \tconst struct alg_sock *ask = alg_sk(sk);\n \tconst struct af_alg_ctx *ctx = ask->private;\n@@ -550,25 +548,11 @@ unsigned int af_alg_count_tsgl(struct sock *sk, size_t bytes, size_t offset)\n \t\tconst struct scatterlist *sg = sgl->sg;\n \n \t\tfor (i = 0; i < sgl->cur; i++) {\n-\t\t\tsize_t bytes_count;\n-\n-\t\t\t/* Skip offset */\n-\t\t\tif (offset >= sg[i].length) {\n-\t\t\t\toffset -= sg[i].length;\n-\t\t\t\tbytes -= sg[i].length;\n-\t\t\t\tcontinue;\n-\t\t\t}\n-\n-\t\t\tbytes_count = sg[i].length - offset;\n-\n-\t\t\toffset = 0;\n \t\t\tsgl_count++;\n-\n-\t\t\t/* If we have seen requested number of bytes, stop */\n-\t\t\tif (bytes_count >= bytes)\n+\t\t\tif (sg[i].length >= bytes)\n \t\t\t\treturn sgl_count;\n \n-\t\t\tbytes -= bytes_count;\n+\t\t\tbytes -= sg[i].length;\n \t\t}\n \t}\n \n@@ -580,19 +564,14 @@ EXPORT_SYMBOL_GPL(af_alg_count_tsgl);\n  * af_alg_pull_tsgl - Release the specified buffers from TX SGL\n  *\n  * If @dst is non-null, reassign the pages to @dst. The caller must release\n- * the pages. If @dst_offset is given only reassign the pages to @dst starting\n- * at the @dst_offset (byte). The caller must ensure that @dst is large\n- * enough (e.g. by using af_alg_count_tsgl with the same offset).\n+ * the pages.\n  *\n  * @sk: socket of connection to user space\n  * @used: Number of bytes to pull from TX SGL\n  * @dst: If non-NULL, buffer is reassigned to dst SGL instead of releasing. The\n  *\t caller must release the buffers in dst.\n- * @dst_offset: Reassign the TX SGL from given offset. All buffers before\n- *\t        reaching the offset is released.\n  */\n-void af_alg_pull_tsgl(struct sock *sk, size_t used, struct scatterlist *dst,\n-\t\t      size_t dst_offset)\n+void af_alg_pull_tsgl(struct sock *sk, size_t used, struct scatterlist *dst)\n {\n \tstruct alg_sock *ask = alg_sk(sk);\n \tstruct af_alg_ctx *ctx = ask->private;\n@@ -617,18 +596,10 @@ void af_alg_pull_tsgl(struct sock *sk, size_t used, struct scatterlist *dst,\n \t\t\t * SG entries in dst.\n \t\t\t */\n \t\t\tif (dst) {\n-\t\t\t\tif (dst_offset >= plen) {\n-\t\t\t\t\t/* discard page before offset */\n-\t\t\t\t\tdst_offset -= plen;\n-\t\t\t\t} else {\n-\t\t\t\t\t/* reassign page to dst after offset */\n-\t\t\t\t\tget_page(page);\n-\t\t\t\t\tsg_set_page(dst + j, page,\n-\t\t\t\t\t\t    plen - dst_offset,\n-\t\t\t\t\t\t    sg[i].offset + dst_offset);\n-\t\t\t\t\tdst_offset = 0;\n-\t\t\t\t\tj++;\n-\t\t\t\t}\n+\t\t\t\t/* reassign page to dst after offset */\n+\t\t\t\tget_page(page);\n+\t\t\t\tsg_set_page(dst + j, page, plen, sg[i].offset);\n+\t\t\t\tj++;\n \t\t\t}\n \n \t\t\tsg[i].length -= plen;\ndiff --git a/crypto/algif_aead.c b/crypto/algif_aead.c\nindex 38a4ab8c90c72..f59728c021fc8 100644\n--- a/crypto/algif_aead.c\n+++ b/crypto/algif_aead.c\n@@ -26,7 +26,6 @@\n #include <crypto/internal/aead.h>\n #include <crypto/scatterwalk.h>\n #include <crypto/if_alg.h>\n-#include <crypto/skcipher.h>\n #include <linux/init.h>\n #include <linux/list.h>\n #include <linux/kernel.h>\n@@ -72,9 +71,8 @@ static int _aead_recvmsg(struct socket *sock, struct msghdr *msg,\n \tstruct alg_sock *pask = alg_sk(psk);\n \tstruct af_alg_ctx *ctx = ask->private;\n \tstruct crypto_aead *tfm = pask->private;\n-\tunsigned int i, as = crypto_aead_authsize(tfm);\n+\tunsigned int as = crypto_aead_authsize(tfm);\n \tstruct af_alg_async_req *areq;\n-\tstruct af_alg_tsgl *tsgl, *tmp;\n \tstruct scatterlist *rsgl_src, *tsgl_src = NULL;\n \tint err = 0;\n \tsize_t used = 0;\t\t/* [in]  TX bufs to be en/decrypted */\n@@ -154,23 +152,24 @@ static int _aead_recvmsg(struct socket *sock, struct msghdr *msg,\n \t\toutlen -= less;\n \t}\n \n+\t/*\n+\t * Create a per request TX SGL for this request which tracks the\n+\t * SG entries from the global TX SGL.\n+\t */\n \tprocessed = used + ctx->aead_assoclen;\n-\tlist_for_each_entry_safe(tsgl, tmp, &ctx->tsgl_list, list) {\n-\t\tfor (i = 0; i < tsgl->cur; i++) {\n-\t\t\tstruct scatterlist *process_sg = tsgl->sg + i;\n-\n-\t\t\tif (!(process_sg->length) || !sg_page(process_sg))\n-\t\t\t\tcontinue;\n-\t\t\ttsgl_src = process_sg;\n-\t\t\tbreak;\n-\t\t}\n-\t\tif (tsgl_src)\n-\t\t\tbreak;\n-\t}\n-\tif (processed && !tsgl_src) {\n-\t\terr = -EFAULT;\n+\tareq->tsgl_entries = af_alg_count_tsgl(sk, processed);\n+\tif (!areq->tsgl_entries)\n+\t\tareq->tsgl_entries = 1;\n+\tareq->tsgl = sock_kmalloc(sk, array_size(sizeof(*areq->tsgl),\n+\t\t\t\t\t         areq->tsgl_entries),\n+\t\t\t\t  GFP_KERNEL);\n+\tif (!areq->tsgl) {\n+\t\terr = -ENOMEM;\n \t\tgoto free;\n \t}\n+\tsg_init_table(areq->tsgl, areq->tsgl_entries);\n+\taf_alg_pull_tsgl(sk, processed, areq->tsgl);\n+\ttsgl_src = areq->tsgl;\n \n \t/*\n \t * Copy of AAD from source to destination\n@@ -179,75 +178,15 @@ static int _aead_recvmsg(struct socket *sock, struct msghdr *msg,\n \t * when user space uses an in-place cipher operation, the kernel\n \t * will copy the data as it does not see whether such in-place operation\n \t * is initiated.\n-\t *\n-\t * To ensure efficiency, the following implementation ensure that the\n-\t * ciphers are invoked to perform a crypto operation in-place. This\n-\t * is achieved by memory management specified as follows.\n \t */\n \n \t/* Use the RX SGL as source (and destination) for crypto op. */\n \trsgl_src = areq->first_rsgl.sgl.sg;\n \n-\tif (ctx->enc) {\n-\t\t/*\n-\t\t * Encryption operation - The in-place cipher operation is\n-\t\t * achieved by the following operation:\n-\t\t *\n-\t\t * TX SGL: AAD || PT\n-\t\t *\t    |\t   |\n-\t\t *\t    | copy |\n-\t\t *\t    v\t   v\n-\t\t * RX SGL: AAD || PT || Tag\n-\t\t */\n-\t\tmemcpy_sglist(areq->first_rsgl.sgl.sg, tsgl_src, processed);\n-\t\taf_alg_pull_tsgl(sk, processed, NULL, 0);\n-\t} else {\n-\t\t/*\n-\t\t * Decryption operation - To achieve an in-place cipher\n-\t\t * operation, the following  SGL structure is used:\n-\t\t *\n-\t\t * TX SGL: AAD || CT || Tag\n-\t\t *\t    |\t   |\t ^\n-\t\t *\t    | copy |\t | Create SGL link.\n-\t\t *\t    v\t   v\t |\n-\t\t * RX SGL: AAD || CT ----+\n-\t\t */\n-\n-\t\t/* Copy AAD || CT to RX SGL buffer for in-place operation. */\n-\t\tmemcpy_sglist(areq->first_rsgl.sgl.sg, tsgl_src, outlen);\n-\n-\t\t/* Create TX SGL for tag and chain it to RX SGL. */\n-\t\tareq->tsgl_entries = af_alg_count_tsgl(sk, processed,\n-\t\t\t\t\t\t       processed - as);\n-\t\tif (!areq->tsgl_entries)\n-\t\t\tareq->tsgl_entries = 1;\n-\t\tareq->tsgl = sock_kmalloc(sk, array_size(sizeof(*areq->tsgl),\n-\t\t\t\t\t\t\t areq->tsgl_entries),\n-\t\t\t\t\t  GFP_KERNEL);\n-\t\tif (!areq->tsgl) {\n-\t\t\terr = -ENOMEM;\n-\t\t\tgoto free;\n-\t\t}\n-\t\tsg_init_table(areq->tsgl, areq->tsgl_entries);\n-\n-\t\t/* Release TX SGL, except for tag data and reassign tag data. */\n-\t\taf_alg_pull_tsgl(sk, processed, areq->tsgl, processed - as);\n-\n-\t\t/* chain the areq TX SGL holding the tag with RX SGL */\n-\t\tif (usedpages) {\n-\t\t\t/* RX SGL present */\n-\t\t\tstruct af_alg_sgl *sgl_prev = &areq->last_rsgl->sgl;\n-\n-\t\t\tsg_unmark_end(sgl_prev->sg + sgl_prev->npages - 1);\n-\t\t\tsg_chain(sgl_prev->sg, sgl_prev->npages + 1,\n-\t\t\t\t areq->tsgl);\n-\t\t} else\n-\t\t\t/* no RX SGL present (e.g. authentication only) */\n-\t\t\trsgl_src = areq->tsgl;\n-\t}\n+\tmemcpy_sglist(rsgl_src, tsgl_src, ctx->aead_assoclen);\n \n \t/* Initialize the crypto operation */\n-\taead_request_set_crypt(&areq->cra_u.aead_req, rsgl_src,\n+\taead_request_set_crypt(&areq->cra_u.aead_req, tsgl_src,\n \t\t\t       areq->first_rsgl.sgl.sg, used, ctx->iv);\n \taead_request_set_ad(&areq->cra_u.aead_req, ctx->aead_assoclen);\n \taead_request_set_tfm(&areq->cra_u.aead_req, tfm);\n@@ -463,7 +402,7 @@ static void aead_sock_destruct(struct sock *sk)\n \tstruct crypto_aead *tfm = pask->private;\n \tunsigned int ivlen = crypto_aead_ivsize(tfm);\n \n-\taf_alg_pull_tsgl(sk, ctx->used, NULL, 0);\n+\taf_alg_pull_tsgl(sk, ctx->used, NULL);\n \tsock_kzfree_s(sk, ctx->iv, ivlen);\n \tsock_kfree_s(sk, ctx, ctx->len);\n \taf_alg_release_parent(sk);\ndiff --git a/crypto/algif_skcipher.c b/crypto/algif_skcipher.c\nindex ee8890ee8f332..8b314260929fb 100644\n--- a/crypto/algif_skcipher.c\n+++ b/crypto/algif_skcipher.c\n@@ -89,7 +89,7 @@ static int _skcipher_recvmsg(struct socket *sock, struct msghdr *msg,\n \t * Create a per request TX SGL for this request which tracks the\n \t * SG entries from the global TX SGL.\n \t */\n-\tareq->tsgl_entries = af_alg_count_tsgl(sk, len, 0);\n+\tareq->tsgl_entries = af_alg_count_tsgl(sk, len);\n \tif (!areq->tsgl_entries)\n \t\tareq->tsgl_entries = 1;\n \tareq->tsgl = sock_kmalloc(sk, array_size(sizeof(*areq->tsgl),\n@@ -100,7 +100,7 @@ static int _skcipher_recvmsg(struct socket *sock, struct msghdr *msg,\n \t\tgoto free;\n \t}\n \tsg_init_table(areq->tsgl, areq->tsgl_entries);\n-\taf_alg_pull_tsgl(sk, len, areq->tsgl, 0);\n+\taf_alg_pull_tsgl(sk, len, areq->tsgl);\n \n \t/* Initialize the crypto operation */\n \tskcipher_request_set_tfm(&areq->cra_u.skcipher_req, tfm);\n@@ -313,7 +313,7 @@ static void skcipher_sock_destruct(struct sock *sk)\n \tstruct alg_sock *pask = alg_sk(psk);\n \tstruct crypto_skcipher *tfm = pask->private;\n \n-\taf_alg_pull_tsgl(sk, ctx->used, NULL, 0);\n+\taf_alg_pull_tsgl(sk, ctx->used, NULL);\n \tsock_kzfree_s(sk, ctx->iv, crypto_skcipher_ivsize(tfm));\n \tsock_kfree_s(sk, ctx, ctx->len);\n \taf_alg_release_parent(sk);\ndiff --git a/include/crypto/if_alg.h b/include/crypto/if_alg.h\nindex 9af84cad92e93..bc23cd65879bb 100644\n--- a/include/crypto/if_alg.h\n+++ b/include/crypto/if_alg.h\n@@ -230,9 +230,8 @@ static inline bool af_alg_readable(struct sock *sk)\n \treturn PAGE_SIZE <= af_alg_rcvbuf(sk);\n }\n \n-unsigned int af_alg_count_tsgl(struct sock *sk, size_t bytes, size_t offset);\n-void af_alg_pull_tsgl(struct sock *sk, size_t used, struct scatterlist *dst,\n-\t\t      size_t dst_offset);\n+unsigned int af_alg_count_tsgl(struct sock *sk, size_t bytes);\n+void af_alg_pull_tsgl(struct sock *sk, size_t used, struct scatterlist *dst);\n void af_alg_wmem_wakeup(struct sock *sk);\n int af_alg_wait_for_data(struct sock *sk, unsigned flags, unsigned min);\n int af_alg_sendmsg(struct socket *sock, struct msghdr *msg, size_t size,\n",
    "prefixes": [
        "SRU",
        "J",
        "3/9"
    ]
}