From patchwork Thu Jun 13 20:23:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ioanna Alifieraki X-Patchwork-Id: 1115598 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45PwF825lWz9s9y; Fri, 14 Jun 2019 06:24:11 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1hbWGU-0002nC-R9; Thu, 13 Jun 2019 20:24:06 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1hbWGT-0002mk-8J for kernel-team@lists.ubuntu.com; Thu, 13 Jun 2019 20:24:05 +0000 Received: from mail-wr1-f70.google.com ([209.85.221.70]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1hbWGS-0001h7-Uh for kernel-team@lists.ubuntu.com; Thu, 13 Jun 2019 20:24:04 +0000 Received: by mail-wr1-f70.google.com with SMTP id a11so87919wrx.2 for ; Thu, 13 Jun 2019 13:24:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=5lUmZwT9HKdUAGxVxGhM9/sNZYh5qQ2OWFKR8spRO2k=; b=EekwA1ziQ3tRsnX0sRuBEM9yi7AFSDZ6A15Z0ZnFonU2zhzZmzcszVwI8f9k00dBCi KKXHyA84wBEGyr0IZuw6a3BR4BaD3gxn8P6duuPxxa5VrwhGwEEKdOOr/A7jxeU/2zec 0Gf9td8kHeSlH4fedgzu9buFREaXaKInrWouMDoVfNZJy74ICbDvUhQtVQS1dRxHRwCL e5qsY3kfftmJZHBYnXSiLrMaZ3caX7gPWN5ZXXRbZxRCmaLhWySHA8dxM9HPZW+5t/IA xvt7Sl4Bo6kflmhYNHcPQTC974u5dTymt/rS0PEbCX8ro3LWGYn69Zk33FsXmGSeL+Kz WSpw== X-Gm-Message-State: APjAAAXaRGONtXU8CvoIe+fFwk4Z51QnoU8VQ+rNBt3VyEDvIjqaIeLq xjcLxbNrKjvTNXWvj4jlBDlLpqenLAbPBye3y0CRolBy1YN1Wbyfa9VYSWFgfzpcsy9nuxYEeJJ GI/SmfjKFvwLjKp0lqTTLwnBvgGTzx+OtjeIk+y4KOg== X-Received: by 2002:a7b:c8d4:: with SMTP id f20mr5337201wml.90.1560457444484; Thu, 13 Jun 2019 13:24:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqxVUbVrqeDfBY9yu8WMbKSCpROudQQmj5h9oqI4Ns/iCqJaEMtlSOZIAbsFw/hYhHjKQ41lnA== X-Received: by 2002:a7b:c8d4:: with SMTP id f20mr5337192wml.90.1560457444326; Thu, 13 Jun 2019 13:24:04 -0700 (PDT) Received: from localhost ([2a02:c7d:31d6:7200:ecdd:10ea:9dc8:5da7]) by smtp.gmail.com with ESMTPSA id u11sm541273wrn.1.2019.06.13.13.24.03 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Jun 2019 13:24:03 -0700 (PDT) From: Ioanna Alifieraki To: kernel-team@lists.ubuntu.com Subject: [RFC][b/azure][PATCH 1/3] netvsc: unshare skb in VF rx handler Date: Thu, 13 Jun 2019 21:23:59 +0100 Message-Id: <20190613202401.1628-2-ioanna-maria.alifieraki@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190613202401.1628-1-ioanna-maria.alifieraki@canonical.com> References: <20190613202401.1628-1-ioanna-maria.alifieraki@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Stephen Hemminger BugLink: https://bugs.launchpad.net/bugs/1831254 The netvsc VF skb handler should make sure that skb is not shared. Similar logic already exists in bonding and team device drivers. This is not an issue in practice because the VF devicex does not send up shared skb's. But the netvsc driver should do the right thing if it did. Fixes: 0c195567a8f6 ("netvsc: transparent VF management") Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller (cherry picked from commit 996ed04741467f6d1552440c92988b132a9487ec) Signed-off-by: Ioanna Alifieraki --- drivers/net/hyperv/netvsc_drv.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index c0fc30a1f600..c86c79949097 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c @@ -1836,6 +1836,12 @@ static rx_handler_result_t netvsc_vf_handle_frame(struct sk_buff **pskb) struct netvsc_vf_pcpu_stats *pcpu_stats = this_cpu_ptr(ndev_ctx->vf_stats); + skb = skb_share_check(skb, GFP_ATOMIC); + if (unlikely(!skb)) + return RX_HANDLER_CONSUMED; + + *pskb = skb; + skb->dev = ndev; u64_stats_update_begin(&pcpu_stats->syncp);