]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
ipv6: explicitly initialize udp6_addr in udp_sock_create6()
authorCong Wang <xiyou.wangcong@gmail.com>
Wed, 19 Dec 2018 05:17:44 +0000 (21:17 -0800)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit9d394836304d6886bdf4e329c1149330b9178fc9
tree412db3321c39b05af0b24513f1520c747ab69240
parentb3eac6b8e2c6da6f8c98978ae8fad43367a20003
ipv6: explicitly initialize udp6_addr in udp_sock_create6()

BugLink: https://bugs.launchpad.net/bugs/1837257
[ Upstream commit fb24274546310872eeeaf3d1d53799d8414aa0f2 ]

syzbot reported the use of uninitialized udp6_addr::sin6_scope_id.
We can just set ::sin6_scope_id to zero, as tunnels are unlikely
to use an IPv6 address that needs a scope id and there is no
interface to bind in this context.

For net-next, it looks different as we have cfg->bind_ifindex there
so we can probably call ipv6_iface_scope_id().

Same for ::sin6_flowinfo, tunnels don't use it.

Fixes: 8024e02879dd ("udp: Add udp_sock_create for UDP tunnels to open listener socket")
Reported-by: syzbot+c56449ed3652e6720f30@syzkaller.appspotmail.com
Cc: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
net/ipv6/ip6_udp_tunnel.c