1. 30 8月, 2012 11 次提交
  2. 23 8月, 2012 1 次提交
  3. 20 8月, 2012 2 次提交
  4. 16 8月, 2012 2 次提交
    • P
      netfilter: nf_ct_expect: fix possible access to uninitialized timer · 2614f864
      Pablo Neira Ayuso 提交于
      In __nf_ct_expect_check, the function refresh_timer returns 1
      if a matching expectation is found and its timer is successfully
      refreshed. This results in nf_ct_expect_related returning 0.
      Note that at this point:
      
      - the passed expectation is not inserted in the expectation table
        and its timer was not initialized, since we have refreshed one
        matching/existing expectation.
      
      - nf_ct_expect_alloc uses kmem_cache_alloc, so the expectation
        timer is in some undefined state just after the allocation,
        until it is appropriately initialized.
      
      This can be a problem for the SIP helper during the expectation
      addition:
      
       ...
       if (nf_ct_expect_related(rtp_exp) == 0) {
               if (nf_ct_expect_related(rtcp_exp) != 0)
                       nf_ct_unexpect_related(rtp_exp);
       ...
      
      Note that nf_ct_expect_related(rtp_exp) may return 0 for the timer refresh
      case that is detailed above. Then, if nf_ct_unexpect_related(rtcp_exp)
      returns != 0, nf_ct_unexpect_related(rtp_exp) is called, which does:
      
       spin_lock_bh(&nf_conntrack_lock);
       if (del_timer(&exp->timeout)) {
               nf_ct_unlink_expect(exp);
               nf_ct_expect_put(exp);
       }
       spin_unlock_bh(&nf_conntrack_lock);
      
      Note that del_timer always returns false if the timer has been
      initialized.  However, the timer was not initialized since setup_timer
      was not called, therefore, the expectation timer remains in some
      undefined state. If I'm not missing anything, this may lead to the
      removal an unexistent expectation.
      
      To fix this, the optimization that allows refreshing an expectation
      is removed. Now nf_conntrack_expect_related looks more consistent
      to me since it always add the expectation in case that it returns
      success.
      
      Thanks to Patrick McHardy for participating in the discussion of
      this patch.
      
      I think this may be the source of the problem described by:
      http://marc.info/?l=netfilter-devel&m=134073514719421&w=2Reported-by: NRafal Fitt <rafalf@aplusc.com.pl>
      Acked-by: NPatrick McHardy <kaber@trash.net>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      2614f864
    • M
      ipvs: fix info leak in getsockopt(IP_VS_SO_GET_TIMEOUT) · 2d8a041b
      Mathias Krause 提交于
      If at least one of CONFIG_IP_VS_PROTO_TCP or CONFIG_IP_VS_PROTO_UDP is
      not set, __ip_vs_get_timeouts() does not fully initialize the structure
      that gets copied to userland and that for leaks up to 12 bytes of kernel
      stack. Add an explicit memset(0) before passing the structure to
      __ip_vs_get_timeouts() to avoid the info leak.
      Signed-off-by: NMathias Krause <minipli@googlemail.com>
      Cc: Wensong Zhang <wensong@linux-vs.org>
      Cc: Simon Horman <horms@verge.net.au>
      Cc: Julian Anastasov <ja@ssi.bg>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2d8a041b
  5. 14 8月, 2012 1 次提交
  6. 10 8月, 2012 7 次提交
    • P
      netfilter: nf_ct_sip: fix IPv6 address parsing · 02b69cbd
      Patrick McHardy 提交于
      Within SIP messages IPv6 addresses are enclosed in square brackets in most
      cases, with the exception of the "received=" header parameter. Currently
      the helper fails to parse enclosed addresses.
      
      This patch:
      
      - changes the SIP address parsing function to enforce square brackets
        when required, and accept them when not required but present, as
        recommended by RFC 5118.
      
      - adds a new SDP address parsing function that never accepts square
        brackets since SDP doesn't use them.
      
      With these changes, the SIP helper correctly parses all test messages
      from RFC 5118 (Session Initiation Protocol (SIP) Torture Test Messages
      for Internet Protocol Version 6 (IPv6)).
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      02b69cbd
    • P
      netfilter: nf_ct_sip: fix helper name · e9324b2c
      Patrick McHardy 提交于
      Commit 3a8fc53a (netfilter: nf_ct_helper: allocate 16 bytes for the helper
      and policy names) introduced a bug in the SIP helper, the helper name is
      sprinted to the sip_names array instead of instead of into the helper
      structure. This breaks the helper match and the /proc/net/nf_conntrack_expect
      output.
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      e9324b2c
    • J
      ipvs: add pmtu_disc option to disable IP DF for TUN packets · 3654e611
      Julian Anastasov 提交于
      	Disabling PMTU discovery can increase the output packet
      rate but some users have enough resources and prefer to fragment
      than to drop traffic. By default, we copy the DF bit but if
      pmtu_disc is disabled we do not send FRAG_NEEDED messages anymore.
      Signed-off-by: NJulian Anastasov <ja@ssi.bg>
      Signed-off-by: NSimon Horman <horms@verge.net.au>
      3654e611
    • J
      ipvs: implement passive PMTUD for IPIP packets · f2edb9f7
      Julian Anastasov 提交于
      	IPVS is missing the logic to update PMTU in routing
      for its IPIP packets. We monitor the dst_mtu and can return
      FRAG_NEEDED messages but if the tunneled packets get ICMP
      error we can not rely on other traffic to save the lowest
      MTU.
      
      	The following patch adds ICMP handling for IPIP
      packets in incoming direction, from some remote host to
      our local IP used as saddr in the outer header. By this
      way we can forward any related ICMP traffic if it is for IPVS
      TUN connection. For the special case of PMTUD we update the
      routing and if client requested DF we can forward the
      error.
      
      	To properly update the routing we have to bind
      the cached route (dest->dst_cache) to the selected saddr
      because ipv4_update_pmtu uses saddr for dst lookup.
      Add IP_VS_RT_MODE_CONNECT flag to force such binding with
      second route.
      
      	Update ip_vs_tunnel_xmit to provide IP_VS_RT_MODE_CONNECT
      and change the code to copy DF. For now we prefer not to
      force PMTU discovery (outer DF=1) because we don't have
      configuration option to enable or disable PMTUD. As we
      do not keep any packets to resend, we prefer not to
      play games with packets without DF bit because the sender
      is not informed when they are rejected.
      
      	Also, change ops->update_pmtu to be called only
      for local clients because there is no point to update
      MTU for input routes, in our case skb->dst->dev is lo.
      It seems the code is copied from ipip.c where the skb
      dst points to tunnel device.
      Signed-off-by: NJulian Anastasov <ja@ssi.bg>
      Signed-off-by: NSimon Horman <horms@verge.net.au>
      f2edb9f7
    • C
      ipvs: fixed sparse warning · 2b2d2808
      Claudiu Ghioc 提交于
      Removed the following sparse warnings, wether CONFIG_SYSCTL
      is defined or not:
      *       warning: symbol 'ip_vs_control_net_init_sysctl' was not
      	declared. Should it be static?
      *       warning: symbol 'ip_vs_control_net_cleanup_sysctl' was
      	not declared. Should it be static?
      Signed-off-by: NClaudiu Ghioc <claudiu.ghioc@gmail.com>
      Signed-off-by: NSimon Horman <horms@verge.net.au>
      2b2d2808
    • J
      ipvs: generalize app registration in netns · be97fdb5
      Julian Anastasov 提交于
      	Get rid of the ftp_app pointer and allow applications
      to be registered without adding fields in the netns_ipvs structure.
      
      v2: fix coding style as suggested by Pablo Neira Ayuso <pablo@netfilter.org>
      Signed-off-by: NJulian Anastasov <ja@ssi.bg>
      Signed-off-by: NSimon Horman <horms@verge.net.au>
      be97fdb5
    • J
      ipvs: ip_vs_ftp depends on nf_conntrack_ftp helper · aaea4ed7
      Julian Anastasov 提交于
      	The FTP application indirectly depends on the
      nf_conntrack_ftp helper for proper NAT support. If the
      module is not loaded, IPVS can resize the packets for the
      command connection, eg. PASV response but the SEQ adjustment
      logic in ipv4_confirm is not called without helper.
      Signed-off-by: NJulian Anastasov <ja@ssi.bg>
      Signed-off-by: NSimon Horman <horms@verge.net.au>
      aaea4ed7
  7. 17 7月, 2012 2 次提交
  8. 11 7月, 2012 1 次提交
  9. 09 7月, 2012 1 次提交
  10. 05 7月, 2012 4 次提交
  11. 30 6月, 2012 2 次提交
  12. 29 6月, 2012 2 次提交
  13. 28 6月, 2012 4 次提交