All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Alexander Duyck <alexander.duyck@gmail.com>
Cc: Alexander Duyck <alexander.h.duyck@intel.com>,
	netdev@vger.kernel.org, davem@davemloft.net
Subject: Re: [PATCH] net: Validate frames going through the direct_xmit path
Date: Tue, 02 Sep 2014 21:23:40 -0700	[thread overview]
Message-ID: <1409718220.26422.28.camel@edumazet-glaptop2.roam.corp.google.com> (raw)
In-Reply-To: <5406810A.9070900@gmail.com>

On Tue, 2014-09-02 at 19:46 -0700, Alexander Duyck wrote:

> Actually it looks like there are several issues.  One is the bypass
> problem which is the major issue. Another side effect of the original
> patch is that a bad frame will cause us to exit __qdisc_run prematurely
> even if other frames are still in the qdisc.

Hmm... maybe a the following would fix that ?

Also note we lack counters tracking these kind of events (dropped count)

diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index 5b261e91bdbd..e051fdf95783 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -71,9 +71,13 @@ static inline struct sk_buff *dequeue_skb(struct Qdisc *q)
 			skb = NULL;
 	} else {
 		if (!(q->flags & TCQ_F_ONETXQUEUE) || !netif_xmit_frozen_or_stopped(txq)) {
+dequeue:
 			skb = q->dequeue(q);
-			if (skb)
+			if (skb) {
 				skb = validate_xmit_skb(skb, qdisc_dev(q));
+				if (!skb)
+					goto dequeue;
+			}
 		}
 	}
 

  reply	other threads:[~2014-09-03  4:23 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-02 22:55 [PATCH] net: Validate frames going through the direct_xmit path Alexander Duyck
2014-09-02 23:30 ` Eric Dumazet
2014-09-03  2:46   ` Alexander Duyck
2014-09-03  4:23     ` Eric Dumazet [this message]
2014-09-03 11:57     ` Jesper Dangaard Brouer
2014-09-03 11:48 ` [net-next PATCH] qdisc: validate " Jesper Dangaard Brouer
2014-09-03 13:43   ` Eric Dumazet
2014-09-03 13:52     ` Jesper Dangaard Brouer
2014-09-03 14:26       ` Jesper Dangaard Brouer
2014-09-03 15:22         ` Eric Dumazet
2014-09-03 15:24   ` [net-next PATCH V2] " Jesper Dangaard Brouer
2014-09-03 15:56   ` [net-next PATCH V3] " Jesper Dangaard Brouer
2014-09-03 16:08     ` Eric Dumazet
2014-09-03 16:17       ` Jesper Dangaard Brouer
2014-09-04  3:43     ` David Miller

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=1409718220.26422.28.camel@edumazet-glaptop2.roam.corp.google.com \
    --to=eric.dumazet@gmail.com \
    --cc=alexander.duyck@gmail.com \
    --cc=alexander.h.duyck@intel.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.