1. 29 5月, 2013 4 次提交
  2. 28 5月, 2013 1 次提交
    • M
      ipv4: fix redirect handling for TCP packets · f96ef988
      Michal Kubecek 提交于
      Unlike ipv4_redirect() and ipv4_sk_redirect(), ip_do_redirect()
      doesn't call __build_flow_key() directly but via
      ip_rt_build_flow_key() wrapper. This leads to __build_flow_key()
      getting pointer to IPv4 header of the ICMP redirect packet
      rather than pointer to the embedded IPv4 header of the packet
      initiating the redirect.
      
      As a result, handling of ICMP redirects initiated by TCP packets
      is broken. Issue was introduced by
      
      	4895c771 ("ipv4: Add FIB nexthop exceptions.")
      Signed-off-by: NMichal Kubecek <mkubecek@suse.cz>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f96ef988
  3. 27 5月, 2013 4 次提交
  4. 26 5月, 2013 1 次提交
    • E
      ip_tunnel: fix kernel panic with icmp_dest_unreach · a6222602
      Eric Dumazet 提交于
      Daniel Petre reported crashes in icmp_dst_unreach() with following call
      graph:
      
      #3 [ffff88003fc03938] __stack_chk_fail at ffffffff81037f77
      #4 [ffff88003fc03948] icmp_send at ffffffff814d5fec
      #5 [ffff88003fc03ae8] ipv4_link_failure at ffffffff814a1795
      #6 [ffff88003fc03af8] ipgre_tunnel_xmit at ffffffff814e7965
      #7 [ffff88003fc03b78] dev_hard_start_xmit at ffffffff8146e032
      #8 [ffff88003fc03bc8] sch_direct_xmit at ffffffff81487d66
      #9 [ffff88003fc03c08] __qdisc_run at ffffffff81487efd
      #10 [ffff88003fc03c48] dev_queue_xmit at ffffffff8146e5a7
      #11 [ffff88003fc03c88] ip_finish_output at ffffffff814ab596
      
      Daniel found a similar problem mentioned in
       http://lkml.indiana.edu/hypermail/linux/kernel/1007.0/00961.html
      
      And indeed this is the root cause : skb->cb[] contains data fooling IP
      stack.
      
      We must clear IPCB in ip_tunnel_xmit() sooner in case dst_link_failure()
      is called. Or else skb->cb[] might contain garbage from GSO segmentation
      layer.
      
      A similar fix was tested on linux-3.9, but gre code was refactored in
      linux-3.10. I'll send patches for stable kernels as well.
      
      Many thanks to Daniel for providing reports, patches and testing !
      Reported-by: NDaniel Petre <daniel.petre@rcs-rds.ro>
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a6222602
  5. 24 5月, 2013 4 次提交
  6. 23 5月, 2013 4 次提交
    • C
      netfilter: ipt_ULOG: fix non-null terminated string in the nf_log path · 4f36ea6e
      Chen Gang 提交于
      If nf_log uses ipt_ULOG as logging output, we can deliver non-null
      terminated strings to user-space since the maximum length of the
      prefix that is passed by nf_log is NF_LOG_PREFIXLEN but pm->prefix
      is 32 bytes long (ULOG_PREFIX_LEN).
      
      This is actually happening already from nf_conntrack_tcp if ipt_ULOG
      is used, since it is passing strings longer than 32 bytes.
      Signed-off-by: NChen Gang <gang.chen@asianux.com>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      4f36ea6e
    • F
      netfilter: add nf_ipv6_ops hook to fix xt_addrtype with IPv6 · 2a7851bf
      Florian Westphal 提交于
      Quoting https://bugzilla.netfilter.org/show_bug.cgi?id=812:
      
      [ ip6tables -m addrtype ]
      When I tried to use in the nat/PREROUTING it messes up the
      routing cache even if the rule didn't matched at all.
      [..]
      If I remove the --limit-iface-in from the non-working scenario, so just
      use the -m addrtype --dst-type LOCAL it works!
      
      This happens when LOCAL type matching is requested with --limit-iface-in,
      and the default ipv6 route is via the interface the packet we test
      arrived on.
      
      Because xt_addrtype uses ip6_route_output, the ipv6 routing implementation
      creates an unwanted cached entry, and the packet won't make it to the
      real/expected destination.
      
      Silently ignoring --limit-iface-in makes the routing work but it breaks
      rule matching (--dst-type LOCAL with limit-iface-in is supposed to only
      match if the dst address is configured on the incoming interface;
      without --limit-iface-in it will match if the address is reachable
      via lo).
      
      The test should call ipv6_chk_addr() instead.  However, this would add
      a link-time dependency on ipv6.
      
      There are two possible solutions:
      
      1) Revert the commit that moved ipt_addrtype to xt_addrtype,
         and put ipv6 specific code into ip6t_addrtype.
      2) add new "nf_ipv6_ops" struct to register pointers to ipv6 functions.
      
      While the former might seem preferable, Pablo pointed out that there
      are more xt modules with link-time dependeny issues regarding ipv6,
      so lets go for 2).
      Signed-off-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      2a7851bf
    • T
      xfrm: properly handle invalid states as an error · 497574c7
      Timo Teräs 提交于
      The error exit path needs err explicitly set. Otherwise it
      returns success and the only caller, xfrm_output_resume(),
      would oops in skb_dst(skb)->ops derefence as skb_dst(skb) is
      NULL.
      
      Bug introduced in commit bb65a9cb (xfrm: removes a superfluous
      check and add a statistic).
      Signed-off-by: NTimo Teräs <timo.teras@iki.fi>
      Cc: Li RongQing <roy.qing.li@gmail.com>
      Cc: Steffen Klassert <steffen.klassert@secunet.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      497574c7
    • N
      tcp: bug fix in proportional rate reduction. · 35f079eb
      Nandita Dukkipati 提交于
      This patch is a fix for a bug triggering newly_acked_sacked < 0
      in tcp_ack(.).
      
      The bug is triggered by sacked_out decreasing relative to prior_sacked,
      but packets_out remaining the same as pior_packets. This is because the
      snapshot of prior_packets is taken after tcp_sacktag_write_queue() while
      prior_sacked is captured before tcp_sacktag_write_queue(). The problem
      is: tcp_sacktag_write_queue (tcp_match_skb_to_sack() -> tcp_fragment)
      adjusts the pcount for packets_out and sacked_out (MSS change or other
      reason). As a result, this delta in pcount is reflected in
      (prior_sacked - sacked_out) but not in (prior_packets - packets_out).
      
      This patch does the following:
      1) initializes prior_packets at the start of tcp_ack() so as to
      capture the delta in packets_out created by tcp_fragment.
      2) introduces a new "previous_packets_out" variable that snapshots
      packets_out right before tcp_clean_rtx_queue, so pkts_acked can be
      correctly computed as before.
      3) Computes pkts_acked using previous_packets_out, and computes
      newly_acked_sacked using prior_packets.
      Signed-off-by: NNandita Dukkipati <nanditad@google.com>
      Acked-by: NYuchung Cheng <ycheng@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      35f079eb
  7. 22 5月, 2013 1 次提交
  8. 21 5月, 2013 1 次提交
  9. 20 5月, 2013 4 次提交
  10. 19 5月, 2013 1 次提交
  11. 17 5月, 2013 14 次提交
  12. 16 5月, 2013 1 次提交