netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ying Xue <ying.xue@windriver.com>
To: <erik.hugne@ericsson.com>, <netdev@vger.kernel.org>
Cc: tipc-discussion@lists.sourceforge.net
Subject: Re: [PATCH] tipc: reinitialize pointer after skb linearize
Date: Fri, 18 Sep 2015 17:44:02 +0800	[thread overview]
Message-ID: <55FBDCE2.3050906@windriver.com> (raw)
In-Reply-To: <1442565991-4531-1-git-send-email-erik.hugne@ericsson.com>

On 09/18/2015 04:46 PM, erik.hugne@ericsson.com wrote:
> From: Erik Hugne <erik.hugne@ericsson.com>
> 
> The msg pointer into header may change after skb linearization.
> We must reinitialize it after calling skb_linearize to prevent
> operating on a freed or invalid pointer.
> 
> Signed-off-by: Erik Hugne <erik.hugne@ericsson.com>
> Reported-by: Tamás Végh <tamas.vegh@ericsson.com>

Acked-by: Ying Xue <ying.xue@windriver.com>

> ---
>  net/tipc/msg.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/net/tipc/msg.c b/net/tipc/msg.c
> index 562c926..c5ac436 100644
> --- a/net/tipc/msg.c
> +++ b/net/tipc/msg.c
> @@ -539,6 +539,7 @@ bool tipc_msg_lookup_dest(struct net *net, struct sk_buff *skb, int *err)
>  	*err = -TIPC_ERR_NO_NAME;
>  	if (skb_linearize(skb))
>  		return false;
> +	msg = buf_msg(skb);
>  	if (msg_reroute_cnt(msg))
>  		return false;
>  	dnode = addr_domain(net, msg_lookup_scope(msg));
> 


------------------------------------------------------------------------------
_______________________________________________
tipc-discussion mailing list
tipc-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tipc-discussion

  reply	other threads:[~2015-09-18  9:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-18  8:46 [PATCH] tipc: reinitialize pointer after skb linearize erik.hugne
2015-09-18  9:44 ` Ying Xue [this message]
2015-09-21  5:31 ` David Miller

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=55FBDCE2.3050906@windriver.com \
    --to=ying.xue@windriver.com \
    --cc=erik.hugne@ericsson.com \
    --cc=netdev@vger.kernel.org \
    --cc=tipc-discussion@lists.sourceforge.net \
    /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).