Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.0/patches/2218924/?format=api
{ "id": 2218924, "url": "http://patchwork.ozlabs.org/api/1.0/patches/2218924/?format=api", "project": { "id": 15, "url": "http://patchwork.ozlabs.org/api/1.0/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 }, "msgid": "<20260402043743.191992-2-vinicius.peixoto@canonical.com>", "date": "2026-04-02T04:37:43", "name": "[SRU,Q:linux-oracle,1/1] sunrpc: allocate a separate bvec array for socket sends", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "5dfd173d048a2a50b5e4e534b98aa2950bc191b7", "submitter": { "id": 88880, "url": "http://patchwork.ozlabs.org/api/1.0/people/88880/?format=api", "name": "Vinicius Peixoto", "email": "vinicius.peixoto@canonical.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/ubuntu-kernel/patch/20260402043743.191992-2-vinicius.peixoto@canonical.com/mbox/", "series": [ { "id": 498425, "url": "http://patchwork.ozlabs.org/api/1.0/series/498425/?format=api", "date": "2026-04-02T04:37:42", "name": "oracle: backport \"sunrpc: allocate a separate bvec array for socket sends\" to 6.17", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/498425/mbox/" } ], "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2218924/checks/", "tags": {}, "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=XHB29b4X;\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 4fmTcR2dvBz1yFv\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 02 Apr 2026 15:37:59 +1100 (AEDT)", "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 1w89oX-0001Ds-3R; Thu, 02 Apr 2026 04:37:53 +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 <vinicius.peixoto@canonical.com>)\n id 1w89oV-00018w-91\n for kernel-team@lists.ubuntu.com; Thu, 02 Apr 2026 04:37:51 +0000", "from mail-qk1-f199.google.com (mail-qk1-f199.google.com\n [209.85.222.199])\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 227043F13F\n for <kernel-team@lists.ubuntu.com>; Thu, 2 Apr 2026 04:37:51 +0000 (UTC)", "by mail-qk1-f199.google.com with SMTP id\n af79cd13be357-8d1d0db3a87so124458185a.1\n for <kernel-team@lists.ubuntu.com>; Wed, 01 Apr 2026 21:37:51 -0700 (PDT)", "from canonical.com ([2001:67c:1562:8007::aac:4950])\n by smtp.gmail.com with UTF8SMTPSA id\n af79cd13be357-8d2a5d5a096sm138764085a.19.2026.04.01.21.37.48\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 01 Apr 2026 21:37:49 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com;\n s=20251003; t=1775104671;\n bh=f56sZcpeYNLCrKgPVhcBqOygQMbW9OGRg2cG3rlk6jQ=;\n h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n MIME-Version;\n b=XHB29b4X2+5OgcFtZAGtmg3enCOEAuwQQCqvPYhW0yqALrho8+a7QxlZTpmw9+5dy\n +N7QhzOA+LX10UP1IlFtOSn64FN6jb3dVNualON4RRB2cILQPoZxw1vUv7o8Szs3pr\n VUy9KojtGYc/Lr9uMeQ5LZV+c+qmx9g7lmXlHt7j2+49UQALWqkPhj4c7CnUNm7eMj\n KZnIP+se0u7Bs569XkQNOjphQwGxplendJbrJv40A7pk6/dPv0MvZEdQ9aYc39rVXN\n pR56nR5GeWVODkrF+VfsAo86RYnfjiODCuE1MNV+AsYGLZbXuCtkl4WMYizK4uCvYJ\n az/e/9xUOiTWoLFdTxg2s4Z3Tlugs3v4O987UIcnclIn3in6mGwojciDIQKfuvUCl7\n rJyILywfdA4UWmmeLjpclaJywBRhx9nq908AqC+BL1sl0UZwDNixel7wZxmG7wSHDc\n I5vKRycGq7vepZbjzvNk0rBh4o+GNLwr5P20G2TiyOUtNNkDD6ucz0XwMX2o40pYpq\n YMmzgPk/+DCI8XFJVNlo8FI03e8LpvQqbkugF7i/9UVQnnOjajo/r3o5lzWmFLSnt+\n ZxF8Xb6GOclwJz03KPifJ42OnVX2OVAQLEgi2a9TYHppWKNk8uEEdWoVRhv+LZ5GJd\n yzoqitwNqVq60RCNFc4D7n5c=", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775104670; x=1775709470;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=f56sZcpeYNLCrKgPVhcBqOygQMbW9OGRg2cG3rlk6jQ=;\n b=ZeMvWEEztph14Ns21wFGdAuthYU57ZjjBSt84kBVIo8DGkt9B1qNpXGIDHfGBKMvom\n EbXsjlQrjtEnRa5mDyFbTjy8YfT0tSvge1UF3zorAG1nqnMm3urglaNQIFlqPA2TY9yZ\n 9p5toDXg+wsCnREiCR1j0PmKUEkl7ZAvNX1jlwTRsNgUTnBvY0c7K7mWZ+JKnKpNxP26\n RHj5FJf2PhlFSucCY7zUi8F2THS4tgAOu/mcxGwn9yIuseoFGcONSiczlhXUi0Jin9if\n qw+4fdrLxnnYLBJv51OkfDXgfEwqAQrjm63FRDzNaCrPqqWWlKL90XHen5l7jxHbR4nx\n 8zCg==", "X-Gm-Message-State": "AOJu0Yz63KYjiPrhJMH1U72fosOW4rhD8KmAyxlFiLJeWVu0mYHmglj0\n NHlm59LLSDkG0jlohaMO730h7aZs88BHa0USHxxja9LFR9ZHD8eG3xYnVq5iVtY3MgAd9/Y/6HM\n FRkHosJOZRXXp4Q2WAHSuPm50cKZEQy9Uj14whNujhYpTmPU5LsRXbzUi1wxZSU99V+POt8r+J5\n MlBn8SvTuyXPDM1yv+", "X-Gm-Gg": "ATEYQzyCX3Qras4hSRKGScITB5J9N2G6cswxTFq28EIJZfkmB4j9BH9pnNnfzB5vSVP\n vQbyXoiq9XPIohxiqjtrG+GTOg6b/mmPm1h1+6Kt43cQSb2R6qHn7BbkGA+MRg5Tr2DOLDDibqr\n Zl1x0WvHd/1NGU1md8YssEmeg4AG7xWW2xkRuJ1W4vV7tgtJ0EPAuNrk6SiRHMUp3F4bVehF01I\n PMe2lqCqKa8yAbud7UkgY0dhGnx2YxvL6kTR/F/RC72D3XEv6ndFevwwiwi/Pxqu5XZqYPKkOlH\n daNf4dwAf+h8DJBe7dZQpYvou+XjU2qiItlF2VPiAy0+cz25CDYKbw/FhqNMpvBxddpZvhpw9RN\n BqpsASdyTuyAsMdkkcofXSLflxRDQ", "X-Received": [ "by 2002:a05:620a:489b:b0:8cd:972d:335 with SMTP id\n af79cd13be357-8d1b5bc0e8bmr939521985a.43.1775104669973;\n Wed, 01 Apr 2026 21:37:49 -0700 (PDT)", "by 2002:a05:620a:489b:b0:8cd:972d:335 with SMTP id\n af79cd13be357-8d1b5bc0e8bmr939520685a.43.1775104669463;\n Wed, 01 Apr 2026 21:37:49 -0700 (PDT)" ], "From": "Vinicius Peixoto <vinicius.peixoto@canonical.com>", "To": "kernel-team@lists.ubuntu.com", "Subject": "[SRU][Q:linux-oracle][PATCH 1/1] sunrpc: allocate a separate bvec\n array for socket sends", "Date": "Thu, 2 Apr 2026 01:37:43 -0300", "Message-ID": "<20260402043743.191992-2-vinicius.peixoto@canonical.com>", "X-Mailer": "git-send-email 2.51.0", "In-Reply-To": "<20260402043743.191992-1-vinicius.peixoto@canonical.com>", "References": "<20260402043743.191992-1-vinicius.peixoto@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: Jeff Layton <jlayton@kernel.org>\n\nBugLink: https://bugs.launchpad.net/bugs/2147073\n\nsvc_tcp_sendmsg() calls xdr_buf_to_bvec() with the second slot of\nrq_bvec as the start, but doesn't reduce the array length by one, which\ncould lead to an array overrun. Also, rq_bvec is always rq_maxpages in\nlength, which can be too short in some cases, since the TCP record\nmarker consumes a slot.\n\nFix both problems by adding a separate bvec array to the svc_sock that\nis specifically for sending. For TCP, make this array one slot longer\nthan rq_maxpages, to account for the record marker. For UDP, only\nallocate as large an array as we need since it's limited to 64k of\npayload.\n\nSigned-off-by: Jeff Layton <jlayton@kernel.org>\nReviewed-by: NeilBrown <neil@brown.name>\nSigned-off-by: Chuck Lever <chuck.lever@oracle.com>\n(cherry picked from commit 6b3b697d65d46a0f640216a3f6c72856c159c567)\nSigned-off-by: Vinicius Peixoto <vinicius.peixoto@canonical.com>\n---\n include/linux/sunrpc/svcsock.h | 3 ++\n net/sunrpc/svcsock.c | 55 +++++++++++++++++++++++++++++-----\n 2 files changed, 51 insertions(+), 7 deletions(-)", "diff": "diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h\nindex 963bbe251e52..de37069aba90 100644\n--- a/include/linux/sunrpc/svcsock.h\n+++ b/include/linux/sunrpc/svcsock.h\n@@ -26,6 +26,9 @@ struct svc_sock {\n \tvoid\t\t\t(*sk_odata)(struct sock *);\n \tvoid\t\t\t(*sk_owspace)(struct sock *);\n \n+\t/* For sends (protected by xpt_mutex) */\n+\tstruct bio_vec\t\t*sk_bvec;\n+\n \t/* private TCP part */\n \t/* On-the-wire fragment header: */\n \t__be32\t\t\tsk_marker;\ndiff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c\nindex b396c85ff072..60cb83dc9a55 100644\n--- a/net/sunrpc/svcsock.c\n+++ b/net/sunrpc/svcsock.c\n@@ -68,6 +68,17 @@\n \n #define RPCDBG_FACILITY\tRPCDBG_SVCXPRT\n \n+/*\n+ * For UDP:\n+ * 1 for header page\n+ * enough pages for RPCSVC_MAXPAYLOAD_UDP\n+ * 1 in case payload is not aligned\n+ * 1 for tail page\n+ */\n+enum {\n+\tSUNRPC_MAX_UDP_SENDPAGES = 1 + RPCSVC_MAXPAYLOAD_UDP / PAGE_SIZE + 1 + 1\n+};\n+\n /* To-do: to avoid tying up an nfsd thread while waiting for a\n * handshake request, the request could instead be deferred.\n */\n@@ -740,14 +751,14 @@ static int svc_udp_sendto(struct svc_rqst *rqstp)\n \tif (svc_xprt_is_dead(xprt))\n \t\tgoto out_notconn;\n \n-\tcount = xdr_buf_to_bvec(rqstp->rq_bvec, rqstp->rq_maxpages, xdr);\n+\tcount = xdr_buf_to_bvec(svsk->sk_bvec, SUNRPC_MAX_UDP_SENDPAGES, xdr);\n \n-\tiov_iter_bvec(&msg.msg_iter, ITER_SOURCE, rqstp->rq_bvec,\n+\tiov_iter_bvec(&msg.msg_iter, ITER_SOURCE, svsk->sk_bvec,\n \t\t count, rqstp->rq_res.len);\n \terr = sock_sendmsg(svsk->sk_sock, &msg);\n \tif (err == -ECONNREFUSED) {\n \t\t/* ICMP error on earlier request. */\n-\t\tiov_iter_bvec(&msg.msg_iter, ITER_SOURCE, rqstp->rq_bvec,\n+\t\tiov_iter_bvec(&msg.msg_iter, ITER_SOURCE, svsk->sk_bvec,\n \t\t\t count, rqstp->rq_res.len);\n \t\terr = sock_sendmsg(svsk->sk_sock, &msg);\n \t}\n@@ -1237,19 +1248,19 @@ static int svc_tcp_sendmsg(struct svc_sock *svsk, struct svc_rqst *rqstp,\n \t*sentp = 0;\n \n \t/* The stream record marker is copied into a temporary page\n-\t * fragment buffer so that it can be included in rq_bvec.\n+\t * fragment buffer so that it can be included in sk_bvec.\n \t */\n \tbuf = page_frag_alloc(&svsk->sk_frag_cache, sizeof(marker),\n \t\t\t GFP_KERNEL);\n \tif (!buf)\n \t\treturn -ENOMEM;\n \tmemcpy(buf, &marker, sizeof(marker));\n-\tbvec_set_virt(rqstp->rq_bvec, buf, sizeof(marker));\n+\tbvec_set_virt(svsk->sk_bvec, buf, sizeof(marker));\n \n-\tcount = xdr_buf_to_bvec(rqstp->rq_bvec + 1, rqstp->rq_maxpages,\n+\tcount = xdr_buf_to_bvec(svsk->sk_bvec + 1, rqstp->rq_maxpages,\n \t\t\t\t&rqstp->rq_res);\n \n-\tiov_iter_bvec(&msg.msg_iter, ITER_SOURCE, rqstp->rq_bvec,\n+\tiov_iter_bvec(&msg.msg_iter, ITER_SOURCE, svsk->sk_bvec,\n \t\t 1 + count, sizeof(marker) + rqstp->rq_res.len);\n \tret = sock_sendmsg(svsk->sk_sock, &msg);\n \tpage_frag_free(buf);\n@@ -1397,6 +1408,20 @@ void svc_sock_update_bufs(struct svc_serv *serv)\n \tspin_unlock_bh(&serv->sv_lock);\n }\n \n+static int svc_sock_sendpages(struct svc_serv *serv, struct socket *sock, int flags)\n+{\n+\tswitch (sock->type) {\n+\tcase SOCK_STREAM:\n+\t\t/* +1 for TCP record marker */\n+\t\tif (flags & SVC_SOCK_TEMPORARY)\n+\t\t\treturn svc_serv_maxpages(serv) + 1;\n+\t\treturn 0;\n+\tcase SOCK_DGRAM:\n+\t\treturn SUNRPC_MAX_UDP_SENDPAGES;\n+\t}\n+\treturn -EINVAL;\n+}\n+\n /*\n * Initialize socket for RPC use and create svc_sock struct\n */\n@@ -1407,12 +1432,26 @@ static struct svc_sock *svc_setup_socket(struct svc_serv *serv,\n \tstruct svc_sock\t*svsk;\n \tstruct sock\t*inet;\n \tint\t\tpmap_register = !(flags & SVC_SOCK_ANONYMOUS);\n+\tint\t\tsendpages;\n \tunsigned long\tpages;\n \n+\tsendpages = svc_sock_sendpages(serv, sock, flags);\n+\tif (sendpages < 0)\n+\t\treturn ERR_PTR(sendpages);\n+\n \tpages = svc_serv_maxpages(serv);\n \tsvsk = kzalloc(struct_size(svsk, sk_pages, pages), GFP_KERNEL);\n \tif (!svsk)\n \t\treturn ERR_PTR(-ENOMEM);\n+\n+\tif (sendpages) {\n+\t\tsvsk->sk_bvec = kcalloc(sendpages, sizeof(*svsk->sk_bvec), GFP_KERNEL);\n+\t\tif (!svsk->sk_bvec) {\n+\t\t\tkfree(svsk);\n+\t\t\treturn ERR_PTR(-ENOMEM);\n+\t\t}\n+\t}\n+\n \tsvsk->sk_maxpages = pages;\n \n \tinet = sock->sk;\n@@ -1424,6 +1463,7 @@ static struct svc_sock *svc_setup_socket(struct svc_serv *serv,\n \t\t\t\t inet->sk_protocol,\n \t\t\t\t ntohs(inet_sk(inet)->inet_sport));\n \t\tif (err < 0) {\n+\t\t\tkfree(svsk->sk_bvec);\n \t\t\tkfree(svsk);\n \t\t\treturn ERR_PTR(err);\n \t\t}\n@@ -1641,5 +1681,6 @@ static void svc_sock_free(struct svc_xprt *xprt)\n \t\tsock_release(sock);\n \n \tpage_frag_cache_drain(&svsk->sk_frag_cache);\n+\tkfree(svsk->sk_bvec);\n \tkfree(svsk);\n }\n", "prefixes": [ "SRU", "Q:linux-oracle", "1/1" ] }