aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
authorStefan Raspl <raspl@linux.vnet.ibm.com>2013-04-21 21:12:29 -0400
committerDavid S. Miller <davem@davemloft.net>2013-04-22 15:39:27 -0400
commitd4ae1f5e5eb3a6b367acb137dec9e9599b0ce3f3 (patch)
tree66029f13e635a86d7e32ea03ad5d6f0a6f0f9de7 /drivers/s390
parent065cc782e7d2fa4b1b31964d75a29fa72138242c (diff)
qeth: Fix missing pointer update
qeth_hdr_chk_and_bounce() can possibly shift the skb->data pointer. However, the existing code didn't update the hdr pointer, which should point to skb->data, accordingly. Symptoms of this issue are sporadic recoveries. Signed-off-by: Stefan Raspl <raspl@linux.vnet.ibm.com> Signed-off-by: Frank Blaschka <blaschka@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/net/qeth_core.h2
-rw-r--r--drivers/s390/net/qeth_core_main.c4
-rw-r--r--drivers/s390/net/qeth_l2_main.c2
-rw-r--r--drivers/s390/net/qeth_l3_main.c2
4 files changed, 6 insertions, 4 deletions
diff --git a/drivers/s390/net/qeth_core.h b/drivers/s390/net/qeth_core.h
index 762d6dd1e8ba..ab4d2861ef3c 100644
--- a/drivers/s390/net/qeth_core.h
+++ b/drivers/s390/net/qeth_core.h
@@ -929,7 +929,7 @@ void qeth_core_get_drvinfo(struct net_device *, struct ethtool_drvinfo *);
929void qeth_dbf_longtext(debug_info_t *id, int level, char *text, ...); 929void qeth_dbf_longtext(debug_info_t *id, int level, char *text, ...);
930int qeth_core_ethtool_get_settings(struct net_device *, struct ethtool_cmd *); 930int qeth_core_ethtool_get_settings(struct net_device *, struct ethtool_cmd *);
931int qeth_set_access_ctrl_online(struct qeth_card *card, int fallback); 931int qeth_set_access_ctrl_online(struct qeth_card *card, int fallback);
932int qeth_hdr_chk_and_bounce(struct sk_buff *, int); 932int qeth_hdr_chk_and_bounce(struct sk_buff *, struct qeth_hdr **, int);
933int qeth_configure_cq(struct qeth_card *, enum qeth_cq); 933int qeth_configure_cq(struct qeth_card *, enum qeth_cq);
934int qeth_hw_trap(struct qeth_card *, enum qeth_diags_trap_action); 934int qeth_hw_trap(struct qeth_card *, enum qeth_diags_trap_action);
935int qeth_query_ipassists(struct qeth_card *, enum qeth_prot_versions prot); 935int qeth_query_ipassists(struct qeth_card *, enum qeth_prot_versions prot);
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index 0aa9462c50ec..a86ce07736ef 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -3717,7 +3717,7 @@ int qeth_get_elements_no(struct qeth_card *card,
3717} 3717}
3718EXPORT_SYMBOL_GPL(qeth_get_elements_no); 3718EXPORT_SYMBOL_GPL(qeth_get_elements_no);
3719 3719
3720int qeth_hdr_chk_and_bounce(struct sk_buff *skb, int len) 3720int qeth_hdr_chk_and_bounce(struct sk_buff *skb, struct qeth_hdr **hdr, int len)
3721{ 3721{
3722 int hroom, inpage, rest; 3722 int hroom, inpage, rest;
3723 3723
@@ -3730,6 +3730,8 @@ int qeth_hdr_chk_and_bounce(struct sk_buff *skb, int len)
3730 return 1; 3730 return 1;
3731 memmove(skb->data - rest, skb->data, skb->len - skb->data_len); 3731 memmove(skb->data - rest, skb->data, skb->len - skb->data_len);
3732 skb->data -= rest; 3732 skb->data -= rest;
3733 skb->tail -= rest;
3734 *hdr = (struct qeth_hdr *)skb->data;
3733 QETH_DBF_MESSAGE(2, "skb bounce len: %d rest: %d\n", len, rest); 3735 QETH_DBF_MESSAGE(2, "skb bounce len: %d rest: %d\n", len, rest);
3734 } 3736 }
3735 return 0; 3737 return 0;
diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c
index e53c0c8ace76..2d425416b0a1 100644
--- a/drivers/s390/net/qeth_l2_main.c
+++ b/drivers/s390/net/qeth_l2_main.c
@@ -781,7 +781,7 @@ static int qeth_l2_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
781 } 781 }
782 782
783 if (card->info.type != QETH_CARD_TYPE_IQD) { 783 if (card->info.type != QETH_CARD_TYPE_IQD) {
784 if (qeth_hdr_chk_and_bounce(new_skb, 784 if (qeth_hdr_chk_and_bounce(new_skb, &hdr,
785 sizeof(struct qeth_hdr_layer2))) 785 sizeof(struct qeth_hdr_layer2)))
786 goto tx_drop; 786 goto tx_drop;
787 rc = qeth_do_send_packet(card, queue, new_skb, hdr, 787 rc = qeth_do_send_packet(card, queue, new_skb, hdr,
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c
index 29914ed8bbbc..449676e48fd0 100644
--- a/drivers/s390/net/qeth_l3_main.c
+++ b/drivers/s390/net/qeth_l3_main.c
@@ -3055,7 +3055,7 @@ static int qeth_l3_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
3055 else 3055 else
3056 len = sizeof(struct qeth_hdr_layer3); 3056 len = sizeof(struct qeth_hdr_layer3);
3057 3057
3058 if (qeth_hdr_chk_and_bounce(new_skb, len)) 3058 if (qeth_hdr_chk_and_bounce(new_skb, &hdr, len))
3059 goto tx_drop; 3059 goto tx_drop;
3060 rc = qeth_do_send_packet(card, queue, new_skb, hdr, 3060 rc = qeth_do_send_packet(card, queue, new_skb, hdr,
3061 elements_needed); 3061 elements_needed);