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
11761176 scratch->csum_unnecessary = !!skb_csum_unnecessary(skb);
11771177 scratch->is_linear = !skb_is_nonlinear(skb);
11781178 #endif
1179− if (likely(!skb->_skb_refdst))
1179+ if (likely(!skb->_skb_refdst && !skb_sec_path(skb)))
11801180 scratch->_tsize_state |= UDP_SKB_IS_STATELESS;
11811181 }
11821182

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