Patch "xfrm: fix "disable_policy" on ipv4 early demux" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    xfrm: fix "disable_policy" on ipv4 early demux

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     xfrm-fix-disable_policy-on-ipv4-early-demux.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 3c1f8ce26a7fd2951da47105171ba4d224fb8dc8
Author: Eyal Birger <eyal.birger@xxxxxxxxx>
Date:   Sun Oct 9 22:16:43 2022 +0300

    xfrm: fix "disable_policy" on ipv4 early demux
    
    [ Upstream commit 3a5913183aa1b14148c723bda030e6102ad73008 ]
    
    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.
    
    Fix by checking the "disable_policy" flag also when a valid dst is
    already available.
    
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=216557
    Reported-by: Monil Patel <monil191989@xxxxxxxxx>
    Fixes: e6175a2ed1f1 ("xfrm: fix "disable_policy" flag use when arriving from different devices")
    Signed-off-by: Eyal Birger <eyal.birger@xxxxxxxxx>
    
    ----
    
    v2: use dev instead of skb->dev
    Signed-off-by: Steffen Klassert <steffen.klassert@xxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c
index 459d7e630cb0..124bf8fdf924 100644
--- a/net/ipv4/ip_input.c
+++ b/net/ipv4/ip_input.c
@@ -364,6 +364,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



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux