All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladislav Yasevich <vladislav.yasevich@hp.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, yjwei@cn.fujitsu.com, jchapman@katalix.com
Subject: Re: ip_queue_xmit() used illegally
Date: Fri, 06 May 2011 17:10:31 -0400	[thread overview]
Message-ID: <4DC463C7.5030407@hp.com> (raw)
In-Reply-To: <20110506.132129.59693228.davem@davemloft.net>

On 05/06/2011 04:21 PM, David Miller wrote:
> From: David Miller <davem@davemloft.net>
> Date: Fri, 06 May 2011 12:26:56 -0700 (PDT)
> 
>> SCTP stores it's binding information using transports and assosciations
>> and does not fill in the ->inet_{daddr,saddr} values.
>>
>> It tries to work around this route issue by checking dst->obsolete
>> directly in sctp_packet_transmit(), which just makes the race smaller
>> and does not eliminate it.  ip_queue_xmit() can still end up with
>> __sk_dst_check() returning NULL and then we end up emitting a
>> potentially bogus packet.
> 
> I take this back, we added this hack where things like SCTP can
> pre-route the packet by hooking up the route to the SKB before
> calling ->queue_xmit.
> 
> And L2TP does something similar.
> 
> So false alarm, nothing to see here :-)
> 
> I still want to clean this up so that this kind of stuff can be
> handled generically inside of ->queue_xmit() by passing in the correct
> addressing information.
> 

Wow, You had me scrambling there for a while.  I was just about to send note
about the pre-hooked route, but you beat me to it.

The reason why sctp doesn't change the inet_addr, is because that address can theoretically
change on ever packet transmit due to multi-homing nature of SCTP.

I'll take a look at ->queue_xmit() to see if SCTP can convert to using that.

-vlad

  reply	other threads:[~2011-05-06 21:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-06 19:26 ip_queue_xmit() used illegally David Miller
2011-05-06 20:21 ` David Miller
2011-05-06 21:10   ` Vladislav Yasevich [this message]
2011-05-06 21:28     ` 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=4DC463C7.5030407@hp.com \
    --to=vladislav.yasevich@hp.com \
    --cc=davem@davemloft.net \
    --cc=jchapman@katalix.com \
    --cc=netdev@vger.kernel.org \
    --cc=yjwei@cn.fujitsu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.