Re: [PATCH net] ipv4: initialize flowi4_flags before calling fib_lookup()

2016-03-23 Thread Sergei Shtylyov
Hello. On 3/22/2016 9:56 PM, Lance Richardson wrote: 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 b

Re: [PATCH net] ipv4: initialize flowi4_flags before calling fib_lookup()

2016-03-22 Thread Cong Wang
On Tue, Mar 22, 2016 at 2:02 PM, David Ahern wrote: > On 3/22/16 2:45 PM, Cong Wang wrote: >> >> @@ -1426,7 +1426,7 @@ int fib_table_lookup(struct fib_table *tb, const >> struct flowi4 *flp, >> nh->nh_flags & RTNH_F_LINKDOWN && >> !(fib_fla

Re: [PATCH net] ipv4: initialize flowi4_flags before calling fib_lookup()

2016-03-22 Thread David Ahern
On 3/22/16 2:45 PM, Cong Wang wrote: @@ -1426,7 +1426,7 @@ int fib_table_lookup(struct fib_table *tb, const struct flowi4 *flp, nh->nh_flags & RTNH_F_LINKDOWN && !(fib_flags & FIB_LOOKUP_IGNORE_LINKSTATE))

Re: [PATCH net] ipv4: initialize flowi4_flags before calling fib_lookup()

2016-03-22 Thread Cong Wang
On Tue, Mar 22, 2016 at 11:29 AM, David Ahern wrote: > On 3/22/16 9:31 AM, Lance Richardson wrote: >> >> 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: >> >>

Re: [PATCH net] ipv4: initialize flowi4_flags before calling fib_lookup()

2016-03-22 Thread Eric Dumazet
On Tue, 2016-03-22 at 13:00 -0600, David Ahern wrote: > On 3/22/16 12:56 PM, Lance Richardson wrote: > > > > Fixes: 58189ca7b2741 ("net: Fix vti use case with oif in dst lookups") > DaveM: this should go into stable releases back to v4.3. > The 'Fixes' tag tells this already ;) $ git describe

Re: [PATCH net] ipv4: initialize flowi4_flags before calling fib_lookup()

2016-03-22 Thread David Miller
From: Lance Richardson Date: Tue, 22 Mar 2016 14:58:59 -0400 (EDT) > Apologies, that should have been [PATCH v2 net]. No worries. Applied and queued up for -stable, thanks.

Re: [PATCH net] ipv4: initialize flowi4_flags before calling fib_lookup()

2016-03-22 Thread David Ahern
On 3/22/16 12:56 PM, Lance Richardson wrote: 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 initiali

Re: [PATCH net] ipv4: initialize flowi4_flags before calling fib_lookup()

2016-03-22 Thread Lance Richardson
Apologies, that should have been [PATCH v2 net]. - Original Message - > From: "Lance Richardson" > To: netdev@vger.kernel.org > Cc: d...@cumulusnetworks.com > Sent: Tuesday, March 22, 2016 2:56:57 PM > Subject: [PATCH net] ipv4: initialize flowi4_flags

[PATCH net] ipv4: initialize flowi4_flags before calling fib_lookup()

2016-03-22 Thread Lance Richardson
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 preve

Re: [PATCH net] ipv4: initialize flowi4_flags before calling fib_lookup()

2016-03-22 Thread Lance Richardson
- Original Message - > From: "David Ahern" > To: "Lance Richardson" , netdev@vger.kernel.org > Sent: Tuesday, March 22, 2016 2:29:02 PM > Subject: Re: [PATCH net] ipv4: initialize flowi4_flags before calling > fib_lookup() > > On 3/22/16 9:31

Re: [PATCH net] ipv4: initialize flowi4_flags before calling fib_lookup()

2016-03-22 Thread David Ahern
On 3/22/16 9:31 AM, Lance Richardson wrote: 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 initializ

[PATCH net] ipv4: initialize flowi4_flags before calling fib_lookup()

2016-03-22 Thread Lance Richardson
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 fl4.flowi4_flags to zero. Signed-off-by: