lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 12 Oct 2020 14:07:49 +0530
From:   Reji Thomas <rejithomas@...iper.net>
To:     dlebrun@...gle.com
Cc:     davem@...emloft.net, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org, rejithomas@...iper.net,
        rejithomas.d@...il.com
Subject: [PATCH SRv6 End.X] Signed-off-by: Reji Thomas <rejithomas@...iper.net>

seg6: Fix End.X nexthop to use oif.
 Currently End.X action doesn't consider the outgoing interface
 while looking up the nexthop.This breaks packet path functionality
 while using link local address as the End.X nexthop.The patch
 fixes this for link local addresses.

Signed-off-by: Reji Thomas <rejithomas@...iper.net>
---
 net/ipv6/seg6_local.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/net/ipv6/seg6_local.c b/net/ipv6/seg6_local.c
index eba23279912d..26a1c1e3e560 100644
--- a/net/ipv6/seg6_local.c
+++ b/net/ipv6/seg6_local.c
@@ -246,6 +246,16 @@ static int input_action_end_x(struct sk_buff *skb, struct seg6_local_lwt *slwt)
 
 	advance_nextseg(srh, &ipv6_hdr(skb)->daddr);
 
+	if (ipv6_addr_type(&slwt->nh6) & IPV6_ADDR_LINKLOCAL) {
+		struct net *net = dev_net(skb->dev);
+		struct net_device *odev;
+
+		odev = dev_get_by_index_rcu(net, slwt->oif);
+		if (!odev)
+			goto drop;
+		skb->dev = odev;
+	}
+
 	seg6_lookup_nexthop(skb, &slwt->nh6, 0);
 
 	return dst_input(skb);
@@ -566,7 +576,8 @@ static struct seg6_action_desc seg6_action_table[] = {
 	},
 	{
 		.action		= SEG6_LOCAL_ACTION_END_X,
-		.attrs		= (1 << SEG6_LOCAL_NH6),
+		.attrs		= ((1 << SEG6_LOCAL_NH6) |
+				   (1 << SEG6_LOCAL_OIF)),
 		.input		= input_action_end_x,
 	},
 	{
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ