[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1285098910.2452.9.camel@edumazet-laptop>
Date: Tue, 21 Sep 2010 21:55:10 +0200
From: Eric Dumazet <eric.dumazet@...il.com>
To: David Miller <davem@...emloft.net>
Cc: amit.salecha@...gic.com, netdev@...r.kernel.org,
ameen.rahman@...gic.com, anirban.chakraborty@...gic.com
Subject: [PATCH] netxen: dont set skb->truesize
Le mardi 21 septembre 2010 à 12:33 -0700, David Miller a écrit :
> From: Amit Salecha <amit.salecha@...gic.com>
> Date: Tue, 21 Sep 2010 03:41:42 -0500
>
> >> So in order to improve "throughput", you were allowing for memory
> >> exhaust and freeze of the _machine_ ?
> >>
> > This won't lead to such problem. truesize is used for accounting only.
>
> Yes, it will.
>
> Do you understand that we enforce both socket-level and system-wide
> networking buffer usage in the stack? And this limiting is based
> upon skb->truesize and therefore only works if skb->truesize is
> accurate?
>
> It's meant to keep people from attacking a server and consuming large
> percentages of system memory with networking buffer memory such that
> other tasks cannot complete successfully.
>
> And by mis-reporting the truesize you are subverting that entirely.
>
> This qlcnic truesize bug is a huge security hole, can't you see this
> now?
>
BTW, drivers/net/netxen/netxen_nic_init.c has same problem.
[PATCH] netxen: dont set skb->truesize
skb->truesize is set in core network.
Dont change it unless dealing with fragments.
Signed-off-by: Eric Dumazet <eric.dumazet@...il.com>
---
drivers/net/netxen/netxen_nic_init.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c
index cabae7b..b075a35 100644
--- a/drivers/net/netxen/netxen_nic_init.c
+++ b/drivers/net/netxen/netxen_nic_init.c
@@ -1540,7 +1540,6 @@ netxen_process_rcv(struct netxen_adapter *adapter,
if (pkt_offset)
skb_pull(skb, pkt_offset);
- skb->truesize = skb->len + sizeof(struct sk_buff);
skb->protocol = eth_type_trans(skb, netdev);
napi_gro_receive(&sds_ring->napi, skb);
@@ -1602,8 +1601,6 @@ netxen_process_lro(struct netxen_adapter *adapter,
skb_put(skb, lro_length + data_offset);
- skb->truesize = skb->len + sizeof(struct sk_buff) + skb_headroom(skb);
-
skb_pull(skb, l2_hdr_offset);
skb->protocol = eth_type_trans(skb, netdev);
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists