netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shmulik Ladkani <shmulik@metanetworks.com>
To: davem@davemloft.net, dlebrun@google.com
Cc: dav.lebrun@gmail.com, netdev@vger.kernel.org,
	Shmulik Ladkani <shmulik.ladkani@gmail.com>
Subject: [PATCH net] ipv6: sr: properly initialize flowi6 prior passing to ip6_route_output
Date: Fri,  7 Dec 2018 09:50:17 +0200	[thread overview]
Message-ID: <20181207075017.10787-1-shmulik.ladkani@gmail.com> (raw)

In 'seg6_output', stack variable 'struct flowi6 fl6' was missing
initialization.

Fixes: 6c8702c60b88 ("ipv6: sr: add support for SRH encapsulation and injection with lwtunnels")
Signed-off-by: Shmulik Ladkani <shmulik.ladkani@gmail.com>

---
Suggeting this fix, spotted during code review while experimenting
with SRv6, although havn't encountered a specific issue during
experiments.

Was there any genuine intention to actually keep 'fl6' uninitialized?
---

 net/ipv6/seg6_iptunnel.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/ipv6/seg6_iptunnel.c b/net/ipv6/seg6_iptunnel.c
index a8854dd3e9c5..8181ee7e1e27 100644
--- a/net/ipv6/seg6_iptunnel.c
+++ b/net/ipv6/seg6_iptunnel.c
@@ -347,6 +347,7 @@ static int seg6_output(struct net *net, struct sock *sk, struct sk_buff *skb)
 		struct ipv6hdr *hdr = ipv6_hdr(skb);
 		struct flowi6 fl6;
 
+		memset(&fl6, 0, sizeof(fl6));
 		fl6.daddr = hdr->daddr;
 		fl6.saddr = hdr->saddr;
 		fl6.flowlabel = ip6_flowinfo(hdr);
-- 
2.19.1

             reply	other threads:[~2018-12-07  7:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-07  7:50 Shmulik Ladkani [this message]
2018-12-07 20:23 ` [PATCH net] ipv6: sr: properly initialize flowi6 prior passing to ip6_route_output David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181207075017.10787-1-shmulik.ladkani@gmail.com \
    --to=shmulik@metanetworks.com \
    --cc=dav.lebrun@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dlebrun@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=shmulik.ladkani@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).