net: tun: set tun->dev->addr_len during TUNSETLINK processing
stable inclusion from stable-5.10.30 commit 4d9117b7404a4c29b39453490b92441cc6908692 bugzilla: 51791 -------------------------------- commit cca8ea3b upstream. When changing type with TUNSETLINK ioctl command, set tun->dev->addr_len to match the appropriate type, using new tun_get_addr_len utility function which returns appropriate address length for given type. Fixes a KMSAN-found uninit-value bug reported by syzbot at: https://syzkaller.appspot.com/bug?id=0766d38c656abeace60621896d705743aeefed51 Reported-by:<syzbot+001516d86dbe88862cec@syzkaller.appspotmail.com> Diagnosed-by:
Eric Dumazet <edumazet@google.com> Signed-off-by:
Phillip Potter <phil@philpotter.co.uk> Reviewed-by:
Eric Dumazet <edumazet@google.com> Signed-off-by:
David S. Miller <davem@davemloft.net> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by:
Chen Jun <chenjun102@huawei.com> Acked-by:
Weilong Chen <chenweilong@huawei.com> Signed-off-by:
Zheng Zengkai <zhengzengkai@huawei.com>
Loading
Please sign in to comment