netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: paul.gortmaker@windriver.com
Cc: netdev@vger.kernel.org, allan.stephens@windriver.com
Subject: Re: [PATCH net-next 3/4] tipc: Optimize handling excess content on incoming messages
Date: Fri, 03 Sep 2010 12:55:33 -0700 (PDT)	[thread overview]
Message-ID: <20100903.125533.173857867.davem@davemloft.net> (raw)
In-Reply-To: <1283538822-25718-3-git-send-email-paul.gortmaker@windriver.com>

From: Paul Gortmaker <paul.gortmaker@windriver.com>
Date: Fri,  3 Sep 2010 14:33:41 -0400

> @@ -248,6 +248,7 @@ void tipc_net_route_msg(struct sk_buff *buf)
>  
>  	/* Handle message for another node */
>  	msg_dbg(msg, "NET>SEND>: ");
> +	pskb_trim(buf, msg_size(msg));
>  	tipc_link_send(buf, dnode, msg_link_selector(msg));
>  }

1) pskb_trim() can fail, you need to check the return value
   and act appropriately.

2) pskb_trim() can change all of the packet data pointers, so
   after you call it you need to reload any pointers to the
   packet data area.  At a minimum, you woull need to
   reload 'msg' in this code snippet.

   Otherwise 'msg' can point to freed up memory after the call.

  reply	other threads:[~2010-09-03 19:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-03 18:33 [PATCH net-next 1/4] tipc: Minor optimizations to name table translation code Paul Gortmaker
2010-09-03 18:33 ` [PATCH net-next 2/4] tipc: Ensure outgoing messages on Ethernet have sufficient headroom Paul Gortmaker
2010-09-07  1:13   ` David Miller
2010-09-03 18:33 ` [PATCH net-next 3/4] tipc: Optimize handling excess content on incoming messages Paul Gortmaker
2010-09-03 19:55   ` David Miller [this message]
2010-09-08 23:31     ` Paul Gortmaker
2010-09-10  4:33       ` David Miller
2010-09-03 18:33 ` [PATCH net-next 4/4] tipc: Fix misleading error code when enabling Ethernet bearers Paul Gortmaker
2010-09-07  1:13   ` David Miller
2010-09-07  1:13 ` [PATCH net-next 1/4] tipc: Minor optimizations to name table translation code 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=20100903.125533.173857867.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=allan.stephens@windriver.com \
    --cc=netdev@vger.kernel.org \
    --cc=paul.gortmaker@windriver.com \
    /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).