]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
tipc: compare remote and local protocols in tipc_udp_enable()
authorCong Wang <xiyou.wangcong@gmail.com>
Mon, 10 Dec 2018 23:23:30 +0000 (15:23 -0800)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit589ca5fc24ea73cbb0eaac2d7cde7ef661c644dc
treed3adc83220d374a91cf1f9f1f88674f7e0fe59a8
parent7f8ec35d5a1916c814b73e0e4a0fe602494f91c9
tipc: compare remote and local protocols in tipc_udp_enable()

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

When TIPC_NLA_UDP_REMOTE is an IPv6 mcast address but
TIPC_NLA_UDP_LOCAL is an IPv4 address, a NULL-ptr deref is triggered
as the UDP tunnel sock is initialized to IPv4 or IPv6 sock merely
based on the protocol in local address.

We should just error out when the remote address and local address
have different protocols.

Reported-by: syzbot+eb4da3a20fad2e52555d@syzkaller.appspotmail.com
Cc: Ying Xue <ying.xue@windriver.com>
Cc: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: Jon Maloy <jon.maloy@ericsson.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/tipc/udp_media.c