Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1839975/?format=api
{ "id": 1839975, "url": "http://patchwork.ozlabs.org/api/patches/1839975/?format=api", "web_url": "http://patchwork.ozlabs.org/project/ubuntu-kernel/patch/20230927004025.119111-3-cascardo@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": "<20230927004025.119111-3-cascardo@canonical.com>", "list_archive_url": null, "date": "2023-09-27T00:40:22", "name": "[SRU,OEM-6.1,Lunar,2/5] net: add SKB_HEAD_ALIGN() helper", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "7a34a5f568bee93d6da5cb8861de9d2e7c761fb3", "submitter": { "id": 70574, "url": "http://patchwork.ozlabs.org/api/people/70574/?format=api", "name": "Thadeu Lima de Souza Cascardo", "email": "cascardo@canonical.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/ubuntu-kernel/patch/20230927004025.119111-3-cascardo@canonical.com/mbox/", "series": [ { "id": 375017, "url": "http://patchwork.ozlabs.org/api/series/375017/?format=api", "web_url": "http://patchwork.ozlabs.org/project/ubuntu-kernel/list/?series=375017", "date": "2023-09-27T00:40:20", "name": "CVE-2023-42752", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/375017/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1839975/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1839975/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 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 4RwHpZ0n9Vz1yp8\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 27 Sep 2023 10:40: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 1qlIbd-0004eu-Hf; Wed, 27 Sep 2023 00:40:45 +0000", "from smtp-relay-canonical-0.internal ([10.131.114.83]\n helo=smtp-relay-canonical-0.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 <cascardo@canonical.com>)\n id 1qlIbV-0004cM-Hw\n for kernel-team@lists.ubuntu.com; Wed, 27 Sep 2023 00:40:40 +0000", "from quatroqueijos.lan (1.general.cascardo.us.vpn [10.172.70.58])\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-canonical-0.canonical.com (Postfix) with ESMTPSA id 8EBAD3F123\n for <kernel-team@lists.ubuntu.com>; Wed, 27 Sep 2023 00:40:36 +0000 (UTC)" ], "From": "Thadeu Lima de Souza Cascardo <cascardo@canonical.com>", "To": "kernel-team@lists.ubuntu.com", "Subject": "[SRU OEM-6.1,Lunar 2/5] net: add SKB_HEAD_ALIGN() helper", "Date": "Tue, 26 Sep 2023 21:40:22 -0300", "Message-Id": "<20230927004025.119111-3-cascardo@canonical.com>", "X-Mailer": "git-send-email 2.34.1", "In-Reply-To": "<20230927004025.119111-1-cascardo@canonical.com>", "References": "<20230927004025.119111-1-cascardo@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 Dumazet <edumazet@google.com>\n\nWe have many places using this expression:\n\n SKB_DATA_ALIGN(sizeof(struct skb_shared_info))\n\nUse of SKB_HEAD_ALIGN() will allow to clean them.\n\nSigned-off-by: Eric Dumazet <edumazet@google.com>\nAcked-by: Soheil Hassas Yeganeh <soheil@google.com>\nAcked-by: Paolo Abeni <pabeni@redhat.com>\nReviewed-by: Alexander Duyck <alexanderduyck@fb.com>\nSigned-off-by: Jakub Kicinski <kuba@kernel.org>\n(cherry picked from commit 115f1a5c42bdad9a9ea356fc0b4a39ec7537947f)\nCVE-2023-42572\nSigned-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>\n---\n include/linux/skbuff.h | 8 ++++++++\n net/core/skbuff.c | 18 ++++++------------\n 2 files changed, 14 insertions(+), 12 deletions(-)", "diff": "diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h\nindex 1c2d2f5af2ee..c0adbb36c5de 100644\n--- a/include/linux/skbuff.h\n+++ b/include/linux/skbuff.h\n@@ -261,6 +261,14 @@\n #define SKB_DATA_ALIGN(X)\tALIGN(X, SMP_CACHE_BYTES)\n #define SKB_WITH_OVERHEAD(X)\t\\\n \t((X) - SKB_DATA_ALIGN(sizeof(struct skb_shared_info)))\n+\n+/* For X bytes available in skb->head, what is the minimal\n+ * allocation needed, knowing struct skb_shared_info needs\n+ * to be aligned.\n+ */\n+#define SKB_HEAD_ALIGN(X) (SKB_DATA_ALIGN(X) + \\\n+\tSKB_DATA_ALIGN(sizeof(struct skb_shared_info)))\n+\n #define SKB_MAX_ORDER(X, ORDER) \\\n \tSKB_WITH_OVERHEAD((PAGE_SIZE << (ORDER)) - (X))\n #define SKB_MAX_HEAD(X)\t\t(SKB_MAX_ORDER((X), 0))\ndiff --git a/net/core/skbuff.c b/net/core/skbuff.c\nindex 0fe8b0579f1b..beb53b103728 100644\n--- a/net/core/skbuff.c\n+++ b/net/core/skbuff.c\n@@ -559,8 +559,7 @@ struct sk_buff *__alloc_skb(unsigned int size, gfp_t gfp_mask,\n \t * aligned memory blocks, unless SLUB/SLAB debug is enabled.\n \t * Both skb->head and skb_shared_info are cache line aligned.\n \t */\n-\tsize = SKB_DATA_ALIGN(size);\n-\tsize += SKB_DATA_ALIGN(sizeof(struct skb_shared_info));\n+\tsize = SKB_HEAD_ALIGN(size);\n \tosize = kmalloc_size_roundup(size);\n \tdata = kmalloc_reserve(osize, gfp_mask, node, &pfmemalloc);\n \tif (unlikely(!data))\n@@ -633,8 +632,7 @@ struct sk_buff *__netdev_alloc_skb(struct net_device *dev, unsigned int len,\n \t\tgoto skb_success;\n \t}\n \n-\tlen += SKB_DATA_ALIGN(sizeof(struct skb_shared_info));\n-\tlen = SKB_DATA_ALIGN(len);\n+\tlen = SKB_HEAD_ALIGN(len);\n \n \tif (sk_memalloc_socks())\n \t\tgfp_mask |= __GFP_MEMALLOC;\n@@ -733,8 +731,7 @@ struct sk_buff *__napi_alloc_skb(struct napi_struct *napi, unsigned int len,\n \t\tdata = page_frag_alloc_1k(&nc->page_small, gfp_mask);\n \t\tpfmemalloc = NAPI_SMALL_PAGE_PFMEMALLOC(nc->page_small);\n \t} else {\n-\t\tlen += SKB_DATA_ALIGN(sizeof(struct skb_shared_info));\n-\t\tlen = SKB_DATA_ALIGN(len);\n+\t\tlen = SKB_HEAD_ALIGN(len);\n \n \t\tdata = page_frag_alloc(&nc->page, len, gfp_mask);\n \t\tpfmemalloc = nc->page.pfmemalloc;\n@@ -1901,8 +1898,7 @@ int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail,\n \tif (skb_pfmemalloc(skb))\n \t\tgfp_mask |= __GFP_MEMALLOC;\n \n-\tsize = SKB_DATA_ALIGN(size);\n-\tsize += SKB_DATA_ALIGN(sizeof(struct skb_shared_info));\n+\tsize = SKB_HEAD_ALIGN(size);\n \tsize = kmalloc_size_roundup(size);\n \tdata = kmalloc_reserve(size, gfp_mask, NUMA_NO_NODE, NULL);\n \tif (!data)\n@@ -6262,8 +6258,7 @@ static int pskb_carve_inside_header(struct sk_buff *skb, const u32 off,\n \tif (skb_pfmemalloc(skb))\n \t\tgfp_mask |= __GFP_MEMALLOC;\n \n-\tsize = SKB_DATA_ALIGN(size);\n-\tsize += SKB_DATA_ALIGN(sizeof(struct skb_shared_info));\n+\tsize = SKB_HEAD_ALIGN(size);\n \tsize = kmalloc_size_roundup(size);\n \tdata = kmalloc_reserve(size, gfp_mask, NUMA_NO_NODE, NULL);\n \tif (!data)\n@@ -6381,8 +6376,7 @@ static int pskb_carve_inside_nonlinear(struct sk_buff *skb, const u32 off,\n \tif (skb_pfmemalloc(skb))\n \t\tgfp_mask |= __GFP_MEMALLOC;\n \n-\tsize = SKB_DATA_ALIGN(size);\n-\tsize += SKB_DATA_ALIGN(sizeof(struct skb_shared_info));\n+\tsize = SKB_HEAD_ALIGN(size);\n \tsize = kmalloc_size_roundup(size);\n \tdata = kmalloc_reserve(size, gfp_mask, NUMA_NO_NODE, NULL);\n \tif (!data)\n", "prefixes": [ "SRU", "OEM-6.1", "Lunar", "2/5" ] }