All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 1/2] net_sched: don't do precise pkt_len computation for untrusted packets
@ 2013-03-15  7:41 Jason Wang
  2013-03-15  7:41 ` [PATCH net-next 2/2] net: reset transport header if it was not set before transmission Jason Wang
  2013-03-17 16:10 ` [PATCH net-next 1/2] net_sched: don't do precise pkt_len computation for untrusted packets David Miller
  0 siblings, 2 replies; 15+ messages in thread
From: Jason Wang @ 2013-03-15  7:41 UTC (permalink / raw)
  To: davem, netdev, linux-kernel; +Cc: mst, Jason Wang, Eric Dumazet

Commit 1def9238d4aa2 (net_sched: more precise pkt_len computation) tries to do
precise packet len computation for GSO packets, but it does not check whether
the packets were from untrusted source. This is wrong since: we haven't done
header check before so both gso_segs and headers may not be correct. So this
patch just bypass the precise pkt_len computation for packet from untrusted
source (SKB_GSO_DODGY).

Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 net/core/dev.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 90cee5b..480114d 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2586,7 +2586,7 @@ static void qdisc_pkt_len_init(struct sk_buff *skb)
 	/* To get more precise estimation of bytes sent on wire,
 	 * we add to pkt_len the headers size of all segments
 	 */
-	if (shinfo->gso_size)  {
+	if (shinfo->gso_size && !(shinfo->gso_type & SKB_GSO_DODGY))  {
 		unsigned int hdr_len;
 
 		/* mac layer + network layer */
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2013-03-20 13:46 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-15  7:41 [PATCH net-next 1/2] net_sched: don't do precise pkt_len computation for untrusted packets Jason Wang
2013-03-15  7:41 ` [PATCH net-next 2/2] net: reset transport header if it was not set before transmission Jason Wang
2013-03-16  2:10   ` Eric Dumazet
2013-03-17 16:13     ` David Miller
2013-03-19  9:26       ` Jason Wang
2013-03-19 12:13         ` Eric Dumazet
2013-03-19 12:58           ` Daniel Borkmann
2013-03-19 12:59             ` Eric Dumazet
2013-03-19 13:52               ` Daniel Borkmann
2013-03-17 16:10 ` [PATCH net-next 1/2] net_sched: don't do precise pkt_len computation for untrusted packets David Miller
2013-03-19  9:25   ` Jason Wang
2013-03-19 12:10     ` Eric Dumazet
2013-03-19 12:58       ` Eric Dumazet
2013-03-20  6:19         ` Jason Wang
2013-03-20 13:46           ` Eric Dumazet

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.