linux-uconsole/net/core
Eric Dumazet c5a07578be netpoll: fix netpoll_send_udp() bugs
[ Upstream commit 954fba0274 ]

Bogdan Hamciuc diagnosed and fixed following bug in netpoll_send_udp() :

"skb->len += len;" instead of "skb_put(skb, len);"

Meaning that _if_ a network driver needs to call skb_realloc_headroom(),
only packet headers would be copied, leaving garbage in the payload.

However the skb_realloc_headroom() must be avoided as much as possible
since it requires memory and netpoll tries hard to work even if memory
is exhausted (using a pool of preallocated skbs)

It appears netpoll_send_udp() reserved 16 bytes for the ethernet header,
which happens to work for typicall drivers but not all.

Right thing is to use LL_RESERVED_SPACE(dev)
(And also add dev->needed_tailroom of tailroom)

This patch combines both fixes.

Many thanks to Bogdan for raising this issue.

Reported-by: Bogdan Hamciuc <bogdan.hamciuc@freescale.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Tested-by: Bogdan Hamciuc <bogdan.hamciuc@freescale.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Neil Horman <nhorman@tuxdriver.com>
Reviewed-by: Neil Horman <nhorman@tuxdriver.com>
Reviewed-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-16 08:47:38 -07:00
..
datagram.c Fix a typo in datagram.c and sctp/socket.c. 2010-12-06 13:10:11 -08:00
dev.c Revert "net: maintain namespace isolation between vlan and real device" 2012-06-10 00:33:03 +09:00
dev_addr_lists.c net,rcu: convert call_rcu(ha_rcu_free) to kfree_rcu() 2011-05-07 22:50:52 -07:00
drop_monitor.c net,rcu: convert call_rcu(free_dm_hw_stat) to kfree_rcu() 2011-05-07 22:50:59 -07:00
dst.c net: fix NULL dereferences in check_peer_redir() 2012-02-13 11:06:13 -08:00
ethtool.c ethtool: allow ETHTOOL_GSSET_INFO for users 2012-07-16 08:47:37 -07:00
fib_rules.c fib:fix BUG_ON in fib_nl_newrule when add new fib rule 2011-10-03 11:40:51 -07:00
filter.c bug.h: Move ratelimit warn interfaces to ratelimit.h 2011-05-26 15:00:31 -04:00
flow.c net: Handle different key sizes between address families in flow cache 2011-11-11 09:37:17 -08:00
gen_estimator.c net,rcu: convert call_rcu(__gen_kill_estimator) to kfree_rcu() 2011-05-07 22:50:57 -07:00
gen_stats.c net/core: EXPORT_SYMBOL cleanups 2010-07-12 12:57:55 -07:00
iovec.c net: Limit socket I/O iovec total length to INT_MAX. 2010-10-28 11:47:52 -07:00
kmap_skb.h
link_watch.c net: allow netif_carrier to be called safely from IRQ 2011-08-15 18:31:39 -07:00
Makefile net: Compute protocol sequence numbers and fragment IDs using MD5. 2011-08-15 18:31:35 -07:00
neighbour.c neighbour: Fixed race condition at tbl->nht 2012-03-19 08:57:45 -07:00
net-sysfs.c Delay struct net freeing while there's a sysfs instance refering to it 2011-06-12 17:45:41 -04:00
net-sysfs.h xps: Add CONFIG_XPS 2010-11-28 18:24:14 -08:00
net-traces.c netdev: Add tracepoints to netdev layer 2010-09-07 17:51:33 +02:00
net_namespace.c netns: do not leak net_generic data on failed init 2012-04-27 09:51:21 -07:00
netevent.c net/core: EXPORT_SYMBOL cleanups 2010-07-12 12:57:55 -07:00
netpoll.c netpoll: fix netpoll_send_udp() bugs 2012-07-16 08:47:38 -07:00
pktgen.c pktgen: fix module unload for good 2012-06-10 00:33:03 +09:00
request_sock.c Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2010-12-08 13:47:38 -08:00
rtnetlink.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/linux-2.6-nsfd 2011-05-25 18:10:16 -07:00
scm.c scm: Capture the full credentials of the scm sender 2011-10-03 11:40:54 -07:00
secure_seq.c net: Compute protocol sequence numbers and fragment IDs using MD5. 2011-08-15 18:31:35 -07:00
skbuff.c net: fix a race in sock_queue_err_skb() 2012-04-27 09:51:19 -07:00
sock.c net: sock: validate data_len before allocating skb in sock_alloc_send_pskb() 2012-07-16 08:47:36 -07:00
stream.c net: Fix the condition passed to sk_wait_event() 2010-10-03 20:41:32 -07:00
sysctl_net_core.c net: Kill ratelimit.h dependency in linux/net.h 2011-05-27 13:41:33 -04:00
timestamping.c net: hold sock reference while processing tx timestamps 2011-11-11 09:35:52 -08:00
user_dma.c net/core/user_dma.c: Use frag list abstraction interfaces. 2009-06-09 00:19:10 -07:00
utils.c net: Kill ratelimit.h dependency in linux/net.h 2011-05-27 13:41:33 -04:00