netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: gbastien@versatic.net
Cc: netdev@vger.kernel.org, mathieu.desnoyers@efficios.com,
	rostedt@goodmis.org, mingo@redhat.com
Subject: Re: [PATCH v3] net: Add trace events for all receive exit points
Date: Fri, 16 Nov 2018 19:50:36 -0800 (PST)	[thread overview]
Message-ID: <20181116.195036.1120979831963497428.davem@davemloft.net> (raw)
In-Reply-To: <20181113201326.5627-1-gbastien@versatic.net>

From: Geneviève Bastien <gbastien@versatic.net>
Date: Tue, 13 Nov 2018 15:13:26 -0500

> @@ -5222,9 +5228,14 @@ static void netif_receive_skb_list_internal(struct list_head *head)
>   */
>  int netif_receive_skb(struct sk_buff *skb)
>  {
> +	int ret;
> +
>  	trace_netif_receive_skb_entry(skb);
>  
> -	return netif_receive_skb_internal(skb);
> +	ret = netif_receive_skb_internal(skb);
> +	trace_netif_receive_skb_exit(skb, ret);

Every time I read this code from now on I'm going to say to myself
"oh crap, we reference 'skb' after it's potentially freed up"

I really don't like this.

I know only the pointer is used, but that pointer can be reallocated
to another SLAB object, even another SKB, by the time these exit
tracepoints execute.

Sorry, I can't really convince myself to apply this now.

  reply	other threads:[~2018-11-17 14:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-13 20:13 [PATCH v3] net: Add trace events for all receive exit points Geneviève Bastien
2018-11-17  3:50 ` David Miller [this message]
2018-11-17 18:27   ` Mathieu Desnoyers
2018-11-18  6:19     ` David Miller
2018-11-19 15:27       ` Geneviève Bastien
2018-11-19 17:47         ` Geneviève Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181116.195036.1120979831963497428.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=gbastien@versatic.net \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mingo@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).