diff mbox

[3.8.y.z,extended,stable] Patch "netpoll: Fix missing TXQ unlock and and OOPS." has been added to staging queue

Message ID 1389822586-4348-1-git-send-email-kamal@canonical.com
State New
Headers show

Commit Message

Kamal Mostafa Jan. 15, 2014, 9:49 p.m. UTC
This is a note to let you know that I have just added a patch titled

    netpoll: Fix missing TXQ unlock and and OOPS.

to the linux-3.8.y-queue branch of the 3.8.y.z extended stable tree 
which can be found at:

 http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.8.y-queue

This patch is scheduled to be released in version 3.8.13.16.

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.8.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Kamal

------

From c2d388c2ccd67bd75ca36868ea6385eb3284e988 Mon Sep 17 00:00:00 2001
From: "David S. Miller" <davem@davemloft.net>
Date: Thu, 2 Jan 2014 19:50:52 -0500
Subject: netpoll: Fix missing TXQ unlock and and OOPS.

[ Upstream commit aca5f58f9ba803ec8c2e6bcf890db17589e8dfcc ]

The VLAN tag handling code in netpoll_send_skb_on_dev() has two problems.

1) It exits without unlocking the TXQ.

2) It then tries to queue a NULL skb to npinfo->txq.

Reported-by: Ahmed Tamrawi <atamrawi@iastate.edu>
Signed-off-by: David S. Miller <davem@davemloft.net>
[ kamal: backport to 3.8 (context) ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 net/core/netpoll.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

--
1.8.3.2
diff mbox

Patch

diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index 40c1496..0281162 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -338,8 +338,14 @@  void netpoll_send_skb_on_dev(struct netpoll *np, struct sk_buff *skb,
 					if (vlan_tx_tag_present(skb) &&
 					    !(netif_skb_features(skb) & NETIF_F_HW_VLAN_TX)) {
 						skb = __vlan_put_tag(skb, vlan_tx_tag_get(skb));
-						if (unlikely(!skb))
-							break;
+						if (unlikely(!skb)) {
+							/* This is actually a packet drop, but we
+							 * don't want the code at the end of this
+							 * function to try and re-queue a NULL skb.
+							 */
+							status = NETDEV_TX_OK;
+							goto unlock_txq;
+						}
 						skb->vlan_tci = 0;
 					}

@@ -347,6 +353,7 @@  void netpoll_send_skb_on_dev(struct netpoll *np, struct sk_buff *skb,
 					if (status == NETDEV_TX_OK)
 						txq_trans_update(txq);
 				}
+			unlock_txq:
 				__netif_tx_unlock(txq);

 				if (status == NETDEV_TX_OK)