Subject: Re: [FYI] xfrm: Don't lookup sk_policy for timewait sockets

From: Florian Westphal <[email-masked]>
Date: Thu, 9 Apr 2015 23:21:44 +0200

David Miller <[email-masked]> wrote:
> From: Florian Westphal <[email-masked]>
> Date: Thu, 9 Apr 2015 21:14:41 +0200
> 
> > I re-introduced this in fd158d79d33d3c under the assumption
> > that the input path handles skb->sk timewait sockets correctly
> > after all the early demux changes, afaics tcp edemux can also
> > assign skb->sk timewait sockets.
> > 
> > Also, reporter mentions 3.8 as affected which should not assign
> > tw sockets to skb->sk.
> > 
> > Even more strange, the reporters backtrace seems to indicate
> > crash at end of forward path.
> > 
> > Sebastian, can you disable tw assignment via TPROXY in 3.12 just
> > to see if it makes a difference?
> > 
> > [ not doing the assignment is safe provided you still set tproxy mark
> >   on the skb; policy routing will ensure local delivery ].
> 
> My assumption in my analysis is that TPROXY writes the socket to
> skb->sk, and it is also being forwarded.  And yes this is based
> upon his backtrace.

Right.  However, I think we might have to make more changes than just tproxy.

If we have sockets bound to non-local addresses then why would tcp edemux
not cause same issue?