]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - include/net/nexthop.h
net: fix rtnh_ok()
authorEric Dumazet <edumazet@google.com>
Sat, 7 Apr 2018 20:42:38 +0000 (13:42 -0700)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 14 Aug 2018 10:25:40 +0000 (12:25 +0200)
commite4c6821a3de1a7163f6cd9f781c07340504c7fcd
tree7acd01d8c1eaab5040eabe5daf096185d9791744
parent9d0b5dfc8328ede700b8f6b1e9c0dbe9395b1523
net: fix rtnh_ok()

BugLink: http://bugs.launchpad.net/bugs/1780499
commit b1993a2de12c9e75c35729e2ffbc3a92d50c0d31 upstream.

syzbot reported :

BUG: KMSAN: uninit-value in rtnh_ok include/net/nexthop.h:11 [inline]
BUG: KMSAN: uninit-value in fib_count_nexthops net/ipv4/fib_semantics.c:469 [inline]
BUG: KMSAN: uninit-value in fib_create_info+0x554/0x8d20 net/ipv4/fib_semantics.c:1091

@remaining is an integer, coming from user space.
If it is negative we want rtnh_ok() to return false.

Fixes: 4e902c57417c ("[IPv4]: FIB configuration using struct fib_config")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
include/net/nexthop.h