netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: frank.blaschka@de.ibm.com
To: jgarzik@pobox.com
Cc: netdev@vger.kernel.org, linux-s390@vger.kernel.org,
	Ursula Braun <ursula.braun@de.ibm.com>
Subject: [patch 4/4] qeth: avoid skb_under_panic for malformatted inbound data
Date: Fri, 24 Oct 2008 11:16:55 +0200	[thread overview]
Message-ID: <20081024091734.939461000@de.ibm.com> (raw)
In-Reply-To: 20081024091651.603673000@de.ibm.com

[-- Attachment #1: 605-qeth-panic.diff --]
[-- Type: text/plain, Size: 1270 bytes --]

From: Ursula Braun <ursula.braun@de.ibm.com>

To make the qeth driver more robust in case of malformatted inbound
packets due to hardware problems, an additional check for
OSN-card-type is added for OSN-type packets.

Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
---

 drivers/s390/net/qeth_l2_main.c |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

Index: git_linus/drivers/s390/net/qeth_l2_main.c
===================================================================
--- git_linus.orig/drivers/s390/net/qeth_l2_main.c
+++ git_linus/drivers/s390/net/qeth_l2_main.c
@@ -449,12 +449,15 @@ static void qeth_l2_process_inbound_buff
 			netif_rx(skb);
 			break;
 		case QETH_HEADER_TYPE_OSN:
-			skb_push(skb, sizeof(struct qeth_hdr));
-			skb_copy_to_linear_data(skb, hdr,
+			if (card->info.type == QETH_CARD_TYPE_OSN) {
+				skb_push(skb, sizeof(struct qeth_hdr));
+				skb_copy_to_linear_data(skb, hdr,
 						sizeof(struct qeth_hdr));
-			len = skb->len;
-			card->osn_info.data_cb(skb);
-			break;
+				len = skb->len;
+				card->osn_info.data_cb(skb);
+				break;
+			}
+			/* else unknown */
 		default:
 			dev_kfree_skb_any(skb);
 			QETH_DBF_TEXT(TRACE, 3, "inbunkno");

-- 

      parent reply	other threads:[~2008-10-24  9:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-24  9:16 [patch 0/4] s390: qeth fixes 2.6.28-rc1 frank.blaschka
2008-10-24  9:16 ` [patch 1/4] qeth: remove non-recover-thread checkings frank.blaschka
2008-10-27 18:52   ` Jeff Garzik
2008-10-24  9:16 ` [patch 2/4] qeth: fix offset error in non prealloc header path frank.blaschka
2008-10-24  9:16 ` [patch 3/4] qeth: remove unnecessary support ckeck in sysfs route6 frank.blaschka
2008-10-24  9:16 ` frank.blaschka [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081024091734.939461000@de.ibm.com \
    --to=frank.blaschka@de.ibm.com \
    --cc=jgarzik@pobox.com \
    --cc=linux-s390@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=ursula.braun@de.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).