1. 17 2月, 2011 1 次提交
    • F
      netfilter: tproxy: do not assign timewait sockets to skb->sk · d503b30b
      Florian Westphal 提交于
      Assigning a socket in timewait state to skb->sk can trigger
      kernel oops, e.g. in nfnetlink_log, which does:
      
      if (skb->sk) {
              read_lock_bh(&skb->sk->sk_callback_lock);
              if (skb->sk->sk_socket && skb->sk->sk_socket->file) ...
      
      in the timewait case, accessing sk->sk_callback_lock and sk->sk_socket
      is invalid.
      
      Either all of these spots will need to add a test for sk->sk_state != TCP_TIME_WAIT,
      or xt_TPROXY must not assign a timewait socket to skb->sk.
      
      This does the latter.
      
      If a TW socket is found, assign the tproxy nfmark, but skip the skb->sk assignment,
      thus mimicking behaviour of a '-m socket .. -j MARK/ACCEPT' re-routing rule.
      
      The 'SYN to TW socket' case is left unchanged -- we try to redirect to the
      listener socket.
      
      Cc: Balazs Scheidler <bazsi@balabit.hu>
      Cc: KOVACS Krisztian <hidden@balabit.hu>
      Signed-off-by: NFlorian Westphal <fwestphal@astaro.com>
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      d503b30b
  2. 21 10月, 2010 3 次提交
  3. 08 10月, 2008 1 次提交