diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2011-08-31 08:03:29 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-09-15 14:49:44 -0400 |
commit | 48c830120f2a20b44220aa26feda9ed15f49eaab (patch) | |
tree | 5a9bfdf7493cf53e59350b82d5c3c9017fe403a5 /include/linux/skbuff.h | |
parent | 0542b69e2c57fc9668ce6a03155bea6e1f557901 (diff) | |
download | linux-stable-48c830120f2a20b44220aa26feda9ed15f49eaab.tar.gz linux-stable-48c830120f2a20b44220aa26feda9ed15f49eaab.tar.bz2 linux-stable-48c830120f2a20b44220aa26feda9ed15f49eaab.zip |
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>
Diffstat (limited to 'include/linux/skbuff.h')
-rw-r--r-- | include/linux/skbuff.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 7b996ed86d5b..8bd383caa363 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -524,6 +524,7 @@ static inline struct sk_buff *alloc_skb_fclone(unsigned int size, extern bool skb_recycle_check(struct sk_buff *skb, int skb_size); extern struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src); +extern int skb_copy_ubufs(struct sk_buff *skb, gfp_t gfp_mask); extern struct sk_buff *skb_clone(struct sk_buff *skb, gfp_t priority); extern struct sk_buff *skb_copy(const struct sk_buff *skb, |