aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYossi Kuperman <yossiku@mellanox.com>2017-09-01 08:42:30 -0400
committerDavid S. Miller <davem@davemloft.net>2017-09-01 13:29:34 -0400
commite8a732d1bc3ac313e22249c13a153c3fe54aa577 (patch)
treee2b91d7b5e1c46edac87d37c7ecd2b218585c5cd
parent79e99bdd60b484af9afe0147e85a13e66d5c1cdb (diff)
udp: fix secpath leak
After commit dce4551cb2ad ("udp: preserve head state for IP_CMSG_PASSSEC") we preserve the secpath for the whole skb lifecycle, but we also end up leaking a reference to it. We must clear the head state on skb reception, if secpath is present. Fixes: dce4551cb2ad ("udp: preserve head state for IP_CMSG_PASSSEC") Signed-off-by: Yossi Kuperman <yossiku@mellanox.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/ipv4/udp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index a6dc48d76a29..62344804baae 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1176,7 +1176,7 @@ static void udp_set_dev_scratch(struct sk_buff *skb)
1176 scratch->csum_unnecessary = !!skb_csum_unnecessary(skb); 1176 scratch->csum_unnecessary = !!skb_csum_unnecessary(skb);
1177 scratch->is_linear = !skb_is_nonlinear(skb); 1177 scratch->is_linear = !skb_is_nonlinear(skb);
1178#endif 1178#endif
1179 if (likely(!skb->_skb_refdst)) 1179 if (likely(!skb->_skb_refdst && !skb_sec_path(skb)))
1180 scratch->_tsize_state |= UDP_SKB_IS_STATELESS; 1180 scratch->_tsize_state |= UDP_SKB_IS_STATELESS;
1181} 1181}
1182 1182