]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit629183b35e2c47fedcabb79705de9ac4a95ea9de
tree751d08a8a62e8ea5284b0b277675a5d451574897
parent6aa47630ca4369115bf0e552dfc7fc70e60d508e
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: c8e929e639321 ("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