{"id":831034,"url":"http://patchwork.ozlabs.org/api/1.2/patches/831034/?format=json","web_url":"http://patchwork.ozlabs.org/project/netdev/patch/1509073544-4474-1-git-send-email-jasowang@redhat.com/","project":{"id":7,"url":"http://patchwork.ozlabs.org/api/1.2/projects/7/?format=json","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":"<1509073544-4474-1-git-send-email-jasowang@redhat.com>","list_archive_url":null,"date":"2017-10-27T03:05:44","name":"[V2,net] tuntap: properly align skb->head before building skb","commit_ref":null,"pull_url":null,"state":"accepted","archived":true,"hash":"ca94f185ddad8a9d13a3953cfcf1cbff561c8fea","submitter":{"id":5225,"url":"http://patchwork.ozlabs.org/api/1.2/people/5225/?format=json","name":"Jason Wang","email":"jasowang@redhat.com"},"delegate":{"id":34,"url":"http://patchwork.ozlabs.org/api/1.2/users/34/?format=json","username":"davem","first_name":"David","last_name":"Miller","email":"davem@davemloft.net"},"mbox":"http://patchwork.ozlabs.org/project/netdev/patch/1509073544-4474-1-git-send-email-jasowang@redhat.com/mbox/","series":[{"id":10480,"url":"http://patchwork.ozlabs.org/api/1.2/series/10480/?format=json","web_url":"http://patchwork.ozlabs.org/project/netdev/list/?series=10480","date":"2017-10-27T03:05:44","name":"[V2,net] tuntap: properly align skb->head before building skb","version":2,"mbox":"http://patchwork.ozlabs.org/series/10480/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/831034/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/831034/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>)","ext-mx06.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx06.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=jasowang@redhat.com"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3yNTKP6k5dz9t2x\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri, 27 Oct 2017 14:06:01 +1100 (AEDT)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752003AbdJ0DFz (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tThu, 26 Oct 2017 23:05:55 -0400","from mx1.redhat.com ([209.132.183.28]:47386 \"EHLO mx1.redhat.com\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1751685AbdJ0DFx (ORCPT <rfc822;netdev@vger.kernel.org>);\n\tThu, 26 Oct 2017 23:05:53 -0400","from smtp.corp.redhat.com\n\t(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 54631356EA;\n\tFri, 27 Oct 2017 03:05:53 +0000 (UTC)","from jason-ThinkPad-T450s.redhat.com (ovpn-12-149.pek2.redhat.com\n\t[10.72.12.149])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id B697419CB7;\n\tFri, 27 Oct 2017 03:05:46 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 54631356EA","From":"Jason Wang <jasowang@redhat.com>","To":"netdev@vger.kernel.org, linux-kernel@vger.kernel.org","Cc":"dotweiba@gmail.com, Jason Wang <jasowang@redhat.com>,\n\tEric Dumazet <edumazet@google.com>,\n\tWillem de Bruijn <willemdebruijn.kernel@gmail.com>,\n\tDmitry Vyukov <dvyukov@google.com>, Mark Rutland <mark.rutland@arm.com>","Subject":"[PATCH V2 net] tuntap: properly align skb->head before building skb","Date":"Fri, 27 Oct 2017 11:05:44 +0800","Message-Id":"<1509073544-4474-1-git-send-email-jasowang@redhat.com>","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.11","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.30]);\n\tFri, 27 Oct 2017 03:05:53 +0000 (UTC)","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"},"content":"An unaligned alloc_frag->offset caused by previous allocation will\nresult an unaligned skb->head. This will lead unaligned\nskb_shared_info and then unaligned dataref which requires to be\naligned for accessing on some architecture. Fix this by aligning\nalloc_frag->offset before the frag refilling.\n\nFixes: 0bbd7dad34f8 (\"tun: make tun_build_skb() thread safe\")\nCc: Eric Dumazet <edumazet@google.com>\nCc: Willem de Bruijn <willemdebruijn.kernel@gmail.com>\nCc: Wei Wei <dotweiba@gmail.com>\nCc: Dmitry Vyukov <dvyukov@google.com>\nCc: Mark Rutland <mark.rutland@arm.com>\nReported-by: Wei Wei <dotweiba@gmail.com>\nSigned-off-by: Jason Wang <jasowang@redhat.com>\n---\n- The patch is needed for -stable.\n- Wei, can you try this patch to see if it solves your issue?\n---\n drivers/net/tun.c | 1 +\n 1 file changed, 1 insertion(+)","diff":"diff --git a/drivers/net/tun.c b/drivers/net/tun.c\nindex b9973fb..5550f56 100644\n--- a/drivers/net/tun.c\n+++ b/drivers/net/tun.c\n@@ -1286,6 +1286,7 @@ static struct sk_buff *tun_build_skb(struct tun_struct *tun,\n \tbuflen += SKB_DATA_ALIGN(len + pad);\n \trcu_read_unlock();\n \n+\talloc_frag->offset = ALIGN((u64)alloc_frag->offset, SMP_CACHE_BYTES);\n \tif (unlikely(!skb_page_frag_refill(buflen, alloc_frag, GFP_KERNEL)))\n \t\treturn ERR_PTR(-ENOMEM);\n \n","prefixes":["V2","net"]}