Message ID | 20221123093117.434274-2-steffen.klassert@secunet.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 3a5913183aa1b14148c723bda030e6102ad73008 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [1/6] xfrm: fix "disable_policy" on ipv4 early demux | expand |
Hello: This series was applied to netdev/net.git (master) by Steffen Klassert <steffen.klassert@secunet.com>: On Wed, 23 Nov 2022 10:31:11 +0100 you wrote: > From: Eyal Birger <eyal.birger@gmail.com> > > The commit in the "Fixes" tag tried to avoid a case where policy check > is ignored due to dst caching in next hops. > > However, when the traffic is locally consumed, the dst may be cached > in a local TCP or UDP socket as part of early demux. In this case the > "disable_policy" flag is not checked as ip_route_input_noref() was only > called before caching, and thus, packets after the initial packet in a > flow will be dropped if not matching policies. > > [...] Here is the summary with links: - [1/6] xfrm: fix "disable_policy" on ipv4 early demux https://git.kernel.org/netdev/net/c/3a5913183aa1 - [2/6] xfrm: lwtunnel: squelch kernel warning in case XFRM encap type is not available https://git.kernel.org/netdev/net/c/d83f7040e184 - [3/6] xfrm: replay: Fix ESN wrap around for GSO https://git.kernel.org/netdev/net/c/4b549ccce941 - [4/6] af_key: Fix send_acquire race with pfkey_register https://git.kernel.org/netdev/net/c/7f57f8165cb6 - [5/6] xfrm: Fix oops in __xfrm_state_delete() https://git.kernel.org/netdev/net/c/b97df039a68b - [6/6] xfrm: Fix ignored return value in xfrm6_init() https://git.kernel.org/netdev/net/c/40781bfb836e You are awesome, thank you!
diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c index 1b512390b3cf..e880ce77322a 100644 --- a/net/ipv4/ip_input.c +++ b/net/ipv4/ip_input.c @@ -366,6 +366,11 @@ static int ip_rcv_finish_core(struct net *net, struct sock *sk, iph->tos, dev); if (unlikely(err)) goto drop_error; + } else { + struct in_device *in_dev = __in_dev_get_rcu(dev); + + if (in_dev && IN_DEV_ORCONF(in_dev, NOPOLICY)) + IPCB(skb)->flags |= IPSKB_NOPOLICY; } #ifdef CONFIG_IP_ROUTE_CLASSID