Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966118AbbD2Dvw (ORCPT ); Tue, 28 Apr 2015 23:51:52 -0400 Received: from mail-by2on0128.outbound.protection.outlook.com ([207.46.100.128]:46408 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965853AbbD2Dvv convert rfc822-to-8bit (ORCPT ); Tue, 28 Apr 2015 23:51:51 -0400 Authentication-Results: spf=pass (sender IP is 206.191.229.116) smtp.mailfrom=microsoft.com; davemloft.net; dkim=none (message not signed) header.d=none; From: Dexuan Cui To: KY Srinivasan , "davem@davemloft.net" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "devel@linuxdriverproject.org" , "olaf@aepfle.de" , "apw@canonical.com" , "jasowang@redhat.com" Subject: RE: [PATCH V2 net 1/1] hv_netvsc: Fix a bug in netvsc_start_xmit() Thread-Topic: [PATCH V2 net 1/1] hv_netvsc: Fix a bug in netvsc_start_xmit() Thread-Index: AQHQggzI8Ynitjo7Q0ymAknVG4g1jJ1jU9Bg Date: Wed, 29 Apr 2015 03:51:44 +0000 Message-ID: <066b094eb64e418e835c066214d8ef73@SIXPR30MB031.064d.mgd.msft.net> References: <1430269188-31701-1-git-send-email-kys@microsoft.com> In-Reply-To: <1430269188-31701-1-git-send-email-kys@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [141.251.58.197] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:206.191.229.116;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(438002)(199003)(189002)(51704005)(6806004)(2501003)(86612001)(19580395003)(66066001)(108616004)(33646002)(575784001)(5001770100001)(86362001)(106116001)(62966003)(86146001)(97756001)(2656002)(24736003)(54356999)(46406003)(5001960100001)(76176999)(102836002)(50466002)(46102003)(2900100001)(47776003)(1511001)(23726002)(2201001)(2421001)(16796002)(107886001)(87936001)(19580405001)(77156002)(2950100001)(50986999)(106466001)(92566002);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR03MB1520;H:064-smtp-out.microsoft.com;FPR:;SPF:Pass;MLV:sfv;A:1;MX:1;LANG:en; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR03MB1520; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:CY1PR03MB1520;BCL:0;PCL:0;RULEID:;SRVR:CY1PR03MB1520; X-Forefront-PRVS: 05610E64EE X-OriginatorOrg: microsoft.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Apr 2015 03:51:46.9697 (UTC) X-MS-Exchange-CrossTenant-Id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=72f988bf-86f1-41af-91ab-2d7cd011db47;Ip=[206.191.229.116];Helo=[064-smtp-out.microsoft.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR03MB1520 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1930 Lines: 51 > -----Original Message----- > From: devel [mailto:driverdev-devel-bounces@linuxdriverproject.org] On > Behalf Of K. Y. Srinivasan > Sent: Wednesday, April 29, 2015 9:00 > To: davem@davemloft.net; netdev@vger.kernel.org; linux- > kernel@vger.kernel.org; devel@linuxdriverproject.org; olaf@aepfle.de; > apw@canonical.com; jasowang@redhat.com > Subject: [PATCH V2 net 1/1] hv_netvsc: Fix a bug in netvsc_start_xmit() > > Commit b08cc79155fc26d0d112b1470d1ece5034651a4b eliminated > memory > allocation in the packet send path: > > "hv_netvsc: Eliminate memory allocation in the packet send path > > The network protocol used to communicate with the host is the remote > ndis (rndis) > protocol. We need to decorate each outgoing packet with a rndis header > and > additional rndis state (rndis per-packet state). To manage this state, we > currently allocate memory in the transmit path. Eliminate this allocation > by > requesting additional head room in the skb." > > This commit introduced a bug since it did not account for the case if the skb > was cloned. Fix this bug. > > > Signed-off-by: K. Y. Srinivasan > --- > V2: Used skb_cow_head() based on Dave Miller's feedback > V2: Fixed up the commit log based on feedback from Sergei > Shtylyov > > drivers/net/hyperv/hyperv_net.h | 1 - > drivers/net/hyperv/netvsc.c | 5 ----- > drivers/net/hyperv/netvsc_drv.c | 27 +++++++-------------------- > 3 files changed, 7 insertions(+), 26 deletions(-) Without the patch, the guest can panic due to memory corruption. I confirm the patch can fix the panic I saw. Tested-by: Dexuan Cui -- Dexuan -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/