Skip to content

Commit 2ee653f

Browse files
committed
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec
Steffen Klassert says: ==================== pull request (net): ipsec 2018-10-18 1) Free the xfrm interface gro_cells when deleting the interface, otherwise we leak it. From Li RongQing. 2) net/core/flow.c does not exist anymore, so remove it from the MAINTAINERS file. 3) Fix a slab-out-of-bounds in _decode_session6. From Alexei Starovoitov. 4) Fix RCU protection when policies inserted into thei bydst lists. From Florian Westphal. Please pull or let me know if there are problems. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents eddf016 + 9dffff2 commit 2ee653f

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

MAINTAINERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10122,7 +10122,6 @@ L: netdev@vger.kernel.org
1012210122
T: git git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec.git
1012310123
T: git git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next.git
1012410124
S: Maintained
10125-
F: net/core/flow.c
1012610125
F: net/xfrm/
1012710126
F: net/key/
1012810127
F: net/ipv4/xfrm*

net/ipv6/xfrm6_policy.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl, int reverse)
146146
fl6->daddr = reverse ? hdr->saddr : hdr->daddr;
147147
fl6->saddr = reverse ? hdr->daddr : hdr->saddr;
148148

149-
while (nh + offset + 1 < skb->data ||
150-
pskb_may_pull(skb, nh + offset + 1 - skb->data)) {
149+
while (nh + offset + sizeof(*exthdr) < skb->data ||
150+
pskb_may_pull(skb, nh + offset + sizeof(*exthdr) - skb->data)) {
151151
nh = skb_network_header(skb);
152152
exthdr = (struct ipv6_opt_hdr *)(nh + offset);
153153

net/xfrm/xfrm_interface.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ static void xfrmi_unlink(struct xfrmi_net *xfrmn, struct xfrm_if *xi)
116116

117117
static void xfrmi_dev_free(struct net_device *dev)
118118
{
119+
struct xfrm_if *xi = netdev_priv(dev);
120+
121+
gro_cells_destroy(&xi->gro_cells);
119122
free_percpu(dev->tstats);
120123
}
121124

net/xfrm/xfrm_policy.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -632,9 +632,9 @@ static void xfrm_hash_rebuild(struct work_struct *work)
632632
break;
633633
}
634634
if (newpos)
635-
hlist_add_behind(&policy->bydst, newpos);
635+
hlist_add_behind_rcu(&policy->bydst, newpos);
636636
else
637-
hlist_add_head(&policy->bydst, chain);
637+
hlist_add_head_rcu(&policy->bydst, chain);
638638
}
639639

640640
spin_unlock_bh(&net->xfrm.xfrm_policy_lock);
@@ -774,9 +774,9 @@ int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl)
774774
break;
775775
}
776776
if (newpos)
777-
hlist_add_behind(&policy->bydst, newpos);
777+
hlist_add_behind_rcu(&policy->bydst, newpos);
778778
else
779-
hlist_add_head(&policy->bydst, chain);
779+
hlist_add_head_rcu(&policy->bydst, chain);
780780
__xfrm_policy_link(policy, dir);
781781

782782
/* After previous checking, family can either be AF_INET or AF_INET6 */

0 commit comments

Comments
 (0)