]> git.baikalelectronics.ru Git - kernel.git/commit
net: copy userspace buffers on device forwarding
authorMichael S. Tsirkin <mst@redhat.com>
Wed, 31 Aug 2011 08:03:29 +0000 (08:03 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 15 Sep 2011 18:49:44 +0000 (14:49 -0400)
commit81dcd1993e23fd4cfae1bfc2eed8358503635bb1
tree5a9bfdf7493cf53e59350b82d5c3c9017fe403a5
parent6811868e4829bd0a7d52271c9c06d41fdd7e293a
net: copy userspace buffers on device forwarding

dev_forward_skb loops an skb back into host networking
stack which might hang on the memory indefinitely.
In particular, this can happen in macvtap in bridged mode.
Copy the userspace fragments to avoid blocking the
sender in that case.

As this patch makes skb_copy_ubufs extern now,
I also added some documentation and made it clear
the SKBTX_DEV_ZEROCOPY flag automatically instead
of doing it in all callers. This can be made into a separate
patch if people feel it's worth it.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/skbuff.h
net/core/dev.c
net/core/skbuff.c