Message ID | 1306251543.3026.57.camel@edumazet-laptop |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
Le mardi 24 mai 2011 à 17:39 +0200, Eric Dumazet a écrit : > I would say its more likely a problem with dst metrics changes > > In this crash, we dereference a NULL dst->_metrics 'pointer' in > dst_metric_raw(dst, RTAX_MTU); It seems bridge code uses one fake_rtable You probably want to properly init its _metric field. I can do the patch in one hour eventually, if nobody beats me. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
From: Eric Dumazet <eric.dumazet@gmail.com> Date: Tue, 24 May 2011 17:39:03 +0200 > [PATCH] net: fix __dst_destroy_metrics_generic() > > dst_default_metrics is readonly, we dont want to kfree() it later. > > Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Good catch, applied, thanks. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
From: Eric Dumazet <eric.dumazet@gmail.com> Date: Tue, 24 May 2011 18:27:37 +0200 > It seems bridge code uses one fake_rtable Ugh, forgot about this turd. :-/ All route objects should be dynamically allocated, otherwise we'll constantly have to attend to these static route instances when we make any changes to dst_alloc() or similar. I'll apply the fix you posted for now, but long term this code needs to accomplish it's goals in a different way. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/net/core/dst.c b/net/core/dst.c index 81a4fa1..1badc98 100644 --- a/net/core/dst.c +++ b/net/core/dst.c @@ -315,7 +315,7 @@ void __dst_destroy_metrics_generic(struct dst_entry *dst, unsigned long old) { unsigned long prev, new; - new = (unsigned long) dst_default_metrics; + new = ((unsigned long) dst_default_metrics) | DST_METRICS_READ_ONLY; prev = cmpxchg(&dst->_metrics, old, new); if (prev == old) kfree(__DST_METRICS_PTR(old));