Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/807038/?format=api
{ "id": 807038, "url": "http://patchwork.ozlabs.org/api/patches/807038/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/1504002694-1931-3-git-send-email-steffen.klassert@secunet.com/", "project": { "id": 7, "url": "http://patchwork.ozlabs.org/api/projects/7/?format=api", "name": "Linux network development", "link_name": "netdev", "list_id": "netdev.vger.kernel.org", "list_email": "netdev@vger.kernel.org", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<1504002694-1931-3-git-send-email-steffen.klassert@secunet.com>", "list_archive_url": null, "date": "2017-08-29T10:31:29", "name": "[2/7] esp: Fix locking on page fragment allocation", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "da941044e9b1289a1848eae971ab08c072075bf0", "submitter": { "id": 1442, "url": "http://patchwork.ozlabs.org/api/people/1442/?format=api", "name": "Steffen Klassert", "email": "steffen.klassert@secunet.com" }, "delegate": { "id": 34, "url": "http://patchwork.ozlabs.org/api/users/34/?format=api", "username": "davem", "first_name": "David", "last_name": "Miller", "email": "davem@davemloft.net" }, "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/1504002694-1931-3-git-send-email-steffen.klassert@secunet.com/mbox/", "series": [ { "id": 343, "url": "http://patchwork.ozlabs.org/api/series/343/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=343", "date": "2017-08-29T10:31:28", "name": "[1/7] net: xfrm: don't double-hold dst when sk_policy in use.", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/343/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/807038/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/807038/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<netdev-owner@vger.kernel.org>", "X-Original-To": "patchwork-incoming@ozlabs.org", "Delivered-To": "patchwork-incoming@ozlabs.org", "Authentication-Results": "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)", "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xhQTp2tLYz9s7f\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 29 Aug 2017 20:53:18 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752351AbdH2KcM (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tTue, 29 Aug 2017 06:32:12 -0400", "from a.mx.secunet.com ([62.96.220.36]:50656 \"EHLO a.mx.secunet.com\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1751883AbdH2Kbn (ORCPT <rfc822;netdev@vger.kernel.org>);\n\tTue, 29 Aug 2017 06:31:43 -0400", "from localhost (localhost [127.0.0.1])\n\tby a.mx.secunet.com (Postfix) with ESMTP id 3A097201B3;\n\tTue, 29 Aug 2017 12:31:42 +0200 (CEST)", "from a.mx.secunet.com ([127.0.0.1])\n\tby localhost (a.mx.secunet.com [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id kB0RONTltUmo; Tue, 29 Aug 2017 12:31:41 +0200 (CEST)", "from mail-essen-01.secunet.de (mail-essen-01.secunet.de\n\t[10.53.40.204])\n\t(using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby a.mx.secunet.com (Postfix) with ESMTPS id 8458D20191;\n\tTue, 29 Aug 2017 12:31:41 +0200 (CEST)", "from gauss2.secunet.de (10.182.7.193) by mail-essen-01.secunet.de\n\t(10.53.40.204) with Microsoft SMTP Server id 14.3.361.1;\n\tTue, 29 Aug 2017 12:31:41 +0200", "by gauss2.secunet.de (Postfix, from userid 1000) id DBB44140586;\n\tTue, 29 Aug 2017 12:31:40 +0200 (CEST)" ], "X-Virus-Scanned": "by secunet", "From": "Steffen Klassert <steffen.klassert@secunet.com>", "To": "David Miller <davem@davemloft.net>", "CC": "Herbert Xu <herbert@gondor.apana.org.au>,\n\tSteffen Klassert <steffen.klassert@secunet.com>, <netdev@vger.kernel.org>", "Subject": "[PATCH 2/7] esp: Fix locking on page fragment allocation", "Date": "Tue, 29 Aug 2017 12:31:29 +0200", "Message-ID": "<1504002694-1931-3-git-send-email-steffen.klassert@secunet.com>", "X-Mailer": "git-send-email 2.7.4", "In-Reply-To": "<1504002694-1931-1-git-send-email-steffen.klassert@secunet.com>", "References": "<1504002694-1931-1-git-send-email-steffen.klassert@secunet.com>", "MIME-Version": "1.0", "Content-Type": "text/plain", "X-G-Data-MailSecurity-for-Exchange-State": "0", "X-G-Data-MailSecurity-for-Exchange-Error": "0", "X-G-Data-MailSecurity-for-Exchange-Sender": "23", "X-G-Data-MailSecurity-for-Exchange-Server": "d65e63f7-5c15-413f-8f63-c0d707471c93", "X-EXCLAIMER-MD-CONFIG": "2c86f778-e09b-4440-8b15-867914633a10", "X-G-Data-MailSecurity-for-Exchange-Guid": "E2134711-DDB5-49DD-A4F3-016C01B13BC4", "Sender": "netdev-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<netdev.vger.kernel.org>", "X-Mailing-List": "netdev@vger.kernel.org" }, "content": "We allocate the page fragment for the ESP trailer inside\na spinlock, but consume it outside of the lock. This\nis racy as some other cou could get the same page fragment\nthen. Fix this by consuming the page fragment inside the\nlock too.\n\nFixes: cac2661c53f3 (\"esp4: Avoid skb_cow_data whenever possible\")\nFixes: 03e2a30f6a27 (\"esp6: Avoid skb_cow_data whenever possible\")\nSigned-off-by: Steffen Klassert <steffen.klassert@secunet.com>\n---\n net/ipv4/esp4.c | 5 +++--\n net/ipv6/esp6.c | 5 +++--\n 2 files changed, 6 insertions(+), 4 deletions(-)", "diff": "diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c\nindex dbb31a9..a8ddb95 100644\n--- a/net/ipv4/esp4.c\n+++ b/net/ipv4/esp4.c\n@@ -292,8 +292,6 @@ int esp_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info *\n \n \t\t\tkunmap_atomic(vaddr);\n \n-\t\t\tspin_unlock_bh(&x->lock);\n-\n \t\t\tnfrags = skb_shinfo(skb)->nr_frags;\n \n \t\t\t__skb_fill_page_desc(skb, nfrags, page, pfrag->offset,\n@@ -301,6 +299,9 @@ int esp_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info *\n \t\t\tskb_shinfo(skb)->nr_frags = ++nfrags;\n \n \t\t\tpfrag->offset = pfrag->offset + allocsize;\n+\n+\t\t\tspin_unlock_bh(&x->lock);\n+\n \t\t\tnfrags++;\n \n \t\t\tskb->len += tailen;\ndiff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c\nindex 392def1..4e3fdc88 100644\n--- a/net/ipv6/esp6.c\n+++ b/net/ipv6/esp6.c\n@@ -260,8 +260,6 @@ int esp6_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info\n \n \t\t\tkunmap_atomic(vaddr);\n \n-\t\t\tspin_unlock_bh(&x->lock);\n-\n \t\t\tnfrags = skb_shinfo(skb)->nr_frags;\n \n \t\t\t__skb_fill_page_desc(skb, nfrags, page, pfrag->offset,\n@@ -269,6 +267,9 @@ int esp6_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info\n \t\t\tskb_shinfo(skb)->nr_frags = ++nfrags;\n \n \t\t\tpfrag->offset = pfrag->offset + allocsize;\n+\n+\t\t\tspin_unlock_bh(&x->lock);\n+\n \t\t\tnfrags++;\n \n \t\t\tskb->len += tailen;\n", "prefixes": [ "2/7" ] }