Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
* [ltt-dev] [PATCH] lttng: fix net events to check for null n->dev
@ 2009-03-27 17:13 Gregory Haskins
  2009-03-27 17:52 ` Mathieu Desnoyers
  0 siblings, 1 reply; 2+ messages in thread
From: Gregory Haskins @ 2009-03-27 17:13 UTC (permalink / raw)


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.

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 <ghaskins at novell.com>
---

 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 : "<unk>");
 	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 : "<unk>");
 	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 : "<unk>");
 	data_len += strlen(data.f2) + 1;
 
 	marker = &GET_MARKER(net, napi_complete);





^ permalink raw reply	[flat|nested] 2+ messages in thread

* [ltt-dev] [PATCH] lttng: fix net events to check for null n->dev
  2009-03-27 17:13 [ltt-dev] [PATCH] lttng: fix net events to check for null n->dev Gregory Haskins
@ 2009-03-27 17:52 ` Mathieu Desnoyers
  0 siblings, 0 replies; 2+ messages in thread
From: Mathieu Desnoyers @ 2009-03-27 17:52 UTC (permalink / raw)


* 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 <ghaskins at novell.com>
> ---
> 
>  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 : "<unk>");
>  	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 : "<unk>");
>  	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 : "<unk>");
>  	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




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-03-27 17:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-27 17:13 [ltt-dev] [PATCH] lttng: fix net events to check for null n->dev Gregory Haskins
2009-03-27 17:52 ` Mathieu Desnoyers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox