On Wed, May 15, 2019 at 06:06:58PM -0600, David Ahern wrote: > On 5/15/19 6:03 PM, Wei Wang wrote: > > Thanks Martin. > > Changing __rt6_find_exception_xxx() might not be easy cause other > > callers of this function does not really need to back off and use > > another saddr. > > And the validation of the result is a bit different for different callers. I was thinking other callers can pass NULL for the new arg "saddr2".
> > What about add a new helper for the above 2 cases and just call that > > from both places? That will also do. I think it may even have less code churn on the existing functions. I guess the new helper may just call __rt6_find_exception_rcu() inside with "saddr" first and then again with "saddr2" (if needed)? > > Since this needs to be backported to stable releases, I would say > simplest patch for that is best. > > I have changes queued for this area once net-next opens; I can look at > consolidating as part of that. Some of the functions have mutliple changes since then, I suspect less code churn on these existing functions will make the backport to stable easier also. This bug has been there since 4.15. I think it can take a mement to do it now rather than later.