ipv4: initialize flowi4_flags before calling fib_lookup()
authorLance Richardson <lrichard@redhat.com>
Tue, 22 Mar 2016 18:56:57 +0000 (14:56 -0400)
committerDavid S. Miller <davem@davemloft.net>
Tue, 22 Mar 2016 19:59:23 +0000 (15:59 -0400)
commit4cfc86f3dae6ca38ed49cdd78f458a03d4d87992
tree751d08a8a62e8ea5284b0b277675a5d451574897
parent6e9bdc7271ac8e2af58a2c9a87551d9bd49337a1
ipv4: initialize flowi4_flags before calling fib_lookup()

Field fl4.flowi4_flags is not initialized in fib_compute_spec_dst()
before calling fib_lookup(), which means fib_table_lookup() is
using non-deterministic data at this line:

if (!(flp->flowi4_flags & FLOWI_FLAG_SKIP_NH_OIF)) {

Fix by initializing the entire fl4 structure, which will prevent
similar issues as fields are added in the future by ensuring that
all fields are initialized to zero unless explicitly initialized
to another value.

Fixes: 58189ca7b2741 ("net: Fix vti use case with oif in dst lookups")
Suggested-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: Lance Richardson <lrichard@redhat.com>
Acked-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/fib_frontend.c