History

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.

Yossi Kuperman committed 9 years ago

Commit e8a732d1 parent 79e99bd1 file · +1 −1Browse files

Unified · Split

net/ipv4/udp.c+1−1
@@ -1176,7 +1176,7 @@ static void udp_set_dev_scratch(struct sk_buff *skb) · 1175 unmodified lines
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#endif1178#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

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t