Message ID | 20230516052405.2677554-2-steffen.klassert@secunet.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 430cac487400494c19a8b85299e979bb07b4671f |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [1/7] xfrm: don't check the default policy if the policy allows the packet | expand |
Hello: This series was applied to netdev/net.git (main) by Steffen Klassert <steffen.klassert@secunet.com>: On Tue, 16 May 2023 07:23:59 +0200 you wrote: > From: Sabrina Dubroca <sd@queasysnail.net> > > The current code doesn't let a simple "allow" policy counteract a > default policy blocking all incoming packets: > > ip x p setdefault in block > ip x p a src 192.168.2.1/32 dst 192.168.2.2/32 dir in action allow > > [...] Here is the summary with links: - [1/7] xfrm: don't check the default policy if the policy allows the packet https://git.kernel.org/netdev/net/c/430cac487400 - [2/7] xfrm: release all offloaded policy memory https://git.kernel.org/netdev/net/c/94b95dfaa814 - [3/7] xfrm: Fix leak of dev tracker https://git.kernel.org/netdev/net/c/ec8f32ad9a65 - [4/7] Revert "Fix XFRM-I support for nested ESP tunnels" https://git.kernel.org/netdev/net/c/5fc46f94219d - [5/7] xfrm: Reject optional tunnel/BEET mode templates in outbound policies https://git.kernel.org/netdev/net/c/3d776e31c841 - [6/7] af_key: Reject optional tunnel/BEET mode templates in outbound policies https://git.kernel.org/netdev/net/c/cf3128a7aca5 - [7/7] xfrm: Check if_id in inbound policy/secpath match https://git.kernel.org/netdev/net/c/8680407b6f8f You are awesome, thank you!
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 5c61ec04b839..62be042f2ebc 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c @@ -3712,12 +3712,6 @@ int __xfrm_policy_check(struct sock *sk, int dir, struct sk_buff *skb, } xfrm_nr = ti; - if (net->xfrm.policy_default[dir] == XFRM_USERPOLICY_BLOCK && - !xfrm_nr) { - XFRM_INC_STATS(net, LINUX_MIB_XFRMINNOSTATES); - goto reject; - } - if (npols > 1) { xfrm_tmpl_sort(stp, tpp, xfrm_nr, family); tpp = stp;