![]() |
lvs-devel
|
| To: | Simon Horman <horms@xxxxxxxxxxxx>, Julian Anastasov <ja@xxxxxx>, Wensong Zhang <wensong@xxxxxxxxxxxx> |
|---|---|
| Subject: | [PATCH] ipvs: Keep skb->sk when allocating headroom on tunnel xmit |
| Cc: | <lvs-devel@xxxxxxxxxxxxxxx>, <linux-kernel@xxxxxxxxxxxxxxx>, <netdev@xxxxxxxxxxxxxxx>, <agartrell@xxxxxx>, <kernel-team@xxxxxx>, Calvin Owens <calvinowens@xxxxxx> |
| From: | Calvin Owens <calvinowens@xxxxxx> |
| Date: | Tue, 4 Nov 2014 16:37:40 -0800 |
ip_vs_prepare_tunneled_skb() ignores ->sk when allocating a new
skb, either unconditionally setting ->sk to NULL or allowing
the uninitialized ->sk from a newly allocated skb to leak through
to the caller.
This patch properly copies ->sk and increments its reference count.
Signed-off-by: Calvin Owens <calvinowens@xxxxxx>
---
net/netfilter/ipvs/ip_vs_xmit.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/netfilter/ipvs/ip_vs_xmit.c b/net/netfilter/ipvs/ip_vs_xmit.c
index 437a366..bd90bf8 100644
--- a/net/netfilter/ipvs/ip_vs_xmit.c
+++ b/net/netfilter/ipvs/ip_vs_xmit.c
@@ -846,6 +846,8 @@ ip_vs_prepare_tunneled_skb(struct sk_buff *skb, int skb_af,
new_skb = skb_realloc_headroom(skb, max_headroom);
if (!new_skb)
goto error;
+ if (skb->sk)
+ skb_set_owner_w(new_skb, skb->sk);
consume_skb(skb);
skb = new_skb;
}
--
2.1.1
--
To unsubscribe from this list: send the line "unsubscribe lvs-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: [GIT PULL nf] IPVS Fixes for v3.18, Pablo Neira Ayuso |
|---|---|
| Next by Date: | Re: [PATCH] ipvs: Keep skb->sk when allocating headroom on tunnel xmit, Julian Anastasov |
| Previous by Thread: | Re: [GIT PULL nf] IPVS Fixes for v3.18, Pablo Neira Ayuso |
| Next by Thread: | Re: [PATCH] ipvs: Keep skb->sk when allocating headroom on tunnel xmit, Julian Anastasov |
| Indexes: | [Date] [Thread] [Top] [All Lists] |