From mboxrd@z Thu Jan 1 00:00:00 1970 From: compudj@krystal.dyndns.org (Mathieu Desnoyers) Date: Fri, 27 Mar 2009 13:52:39 -0400 Subject: [ltt-dev] [PATCH] lttng: fix net events to check for null n->dev In-Reply-To: <20090327170721.16456.25463.stgit@dev.haskins.net> References: <20090327170721.16456.25463.stgit@dev.haskins.net> Message-ID: <20090327175239.GA11527@Krystal> * Gregory Haskins (ghaskins at novell.com) wrote: > Hi Mathieu, LTT devs, > I found that I needed this patch to allow LTT 0.116 to play nice with > v2.6.29. I am not 100% sure that I am not papering over a legitimate > issue w.r.t napi->dev being legally NULL. But FWIW, this patch allowed > me to get 0.116 up and running. Note that I saw the same issue in 0.110 > against 29-rc8, but I didnt persue since the newer trees were available. > I suspect the same patch would fix things there as well. > > FWIW: The devices in question seemed to be the built-in skb-queues that > are used as a psuedo device when you use netif_rx(). In these cases > dev == NULL (not sure if this is by design). However, since this path > is probably not that common unless you are using something like tuntap, > I suspect it might be that this has just been a latent bug in LTT. > Thanks a lot for the fix ! Will merge in LTTng 0.117. Mathieu > Regards, > -Greg > > ------------------- > lttng: fix net events to check for null n->dev > > Applies to 29-v0.116 > > Certain napi structures may have a NULL device, and thus will crash when > the net-tracer'er is installed. > > Signed-off-by: Gregory Haskins > --- > > ltt/probes/net-trace.c | 6 +++--- > 1 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/ltt/probes/net-trace.c b/ltt/probes/net-trace.c > index 80254bb..80d3d9c 100644 > --- a/ltt/probes/net-trace.c > +++ b/ltt/probes/net-trace.c > @@ -260,7 +260,7 @@ notrace void probe_net_napi_schedule(struct napi_struct *n) > data.f1 = (unsigned long)n; > data_len += sizeof(data.f1); > /* No need to align for strings */ > - strcpy(data.f2, n->dev->name); > + strcpy(data.f2, n->dev ? n->dev->name : ""); > data_len += strlen(data.f2) + 1; > > marker = &GET_MARKER(net, napi_schedule); > @@ -283,7 +283,7 @@ notrace void probe_net_napi_poll(struct napi_struct *n) > data.f1 = (unsigned long)n; > data_len += sizeof(data.f1); > /* No need to align for strings */ > - strcpy(data.f2, n->dev->name); > + strcpy(data.f2, n->dev ? n->dev->name : ""); > data_len += strlen(data.f2) + 1; > > marker = &GET_MARKER(net, napi_poll); > @@ -306,7 +306,7 @@ notrace void probe_net_napi_complete(struct napi_struct *n) > data.f1 = (unsigned long)n; > data_len += sizeof(data.f1); > /* No need to align for strings */ > - strcpy(data.f2, n->dev->name); > + strcpy(data.f2, n->dev ? n->dev->name : ""); > data_len += strlen(data.f2) + 1; > > marker = &GET_MARKER(net, napi_complete); > > > _______________________________________________ > ltt-dev mailing list > ltt-dev at lists.casi.polymtl.ca > http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev > -- Mathieu Desnoyers OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68