]> git.baikalelectronics.ru Git - kernel.git/commit
fib_trie: Fix shift by 32 in fib_table_lookup
authorAlexander Duyck <aduyck@mirantis.com>
Thu, 28 Jan 2016 21:42:24 +0000 (13:42 -0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 30 Jan 2016 03:41:00 +0000 (19:41 -0800)
commit48d4861e591298008da56904faa98120ea79747c
tree3c4133a1240bf8e40ec6ea4ff964ddc101c4354d
parentb6037886c2d95d5d8a2df3bed686a56cd0570bb5
fib_trie: Fix shift by 32 in fib_table_lookup

The fib_table_lookup function had a shift by 32 that triggered a UBSAN
warning.  This was due to the fact that I had placed the shift first and
then followed it with the check for the suffix length to ignore the
undefined behavior.  If we reorder this so that we verify the suffix is
less than 32 before shifting the value we can avoid the issue.

Reported-by: Toralf Förster <toralf.foerster@gmx.de>
Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/fib_trie.c