From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shmulik Ladkani Subject: [PATCH net] ipv6: sr: properly initialize flowi6 prior passing to ip6_route_output Date: Fri, 7 Dec 2018 09:50:17 +0200 Message-ID: <20181207075017.10787-1-shmulik.ladkani@gmail.com> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: dav.lebrun@gmail.com, netdev@vger.kernel.org, Shmulik Ladkani To: davem@davemloft.net, dlebrun@google.com Return-path: Received: from mail-wr1-f65.google.com ([209.85.221.65]:39414 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725952AbeLGHu3 (ORCPT ); Fri, 7 Dec 2018 02:50:29 -0500 Received: by mail-wr1-f65.google.com with SMTP id t27so2847673wra.6 for ; Thu, 06 Dec 2018 23:50:27 -0800 (PST) Sender: netdev-owner@vger.kernel.org List-ID: 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 --- 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