1. 07 1月, 2015 3 次提交
    • P
      netfilter: nfnetlink: relax strict multicast group check from netlink_bind · 62924af2
      Pablo Neira Ayuso 提交于
      Relax the checking that was introduced in 97840cb6 ("netfilter:
      nfnetlink: fix insufficient validation in nfnetlink_bind") when the
      subscription bitmask is used. Existing userspace code code may request
      to listen to all of the existing netlink groups by setting an all to one
      subscription group bitmask. Netlink already validates subscription via
      setsockopt() for us.
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      62924af2
    • P
      netfilter: nfnetlink: validate nfnetlink header from batch · 9ea2aa8b
      Pablo Neira Ayuso 提交于
      Make sure there is enough room for the nfnetlink header in the
      netlink messages that are part of the batch. There is a similar
      check in netlink_rcv_skb().
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      9ea2aa8b
    • P
      netfilter: conntrack: fix race between confirmation and flush · 8ca3f5e9
      Pablo Neira Ayuso 提交于
      Commit 5195c14c ("netfilter: conntrack: fix race in
      __nf_conntrack_confirm against get_next_corpse") aimed to resolve the
      race condition between the confirmation (packet path) and the flush
      command (from control plane). However, it introduced a crash when
      several packets race to add a new conntrack, which seems easier to
      reproduce when nf_queue is in place.
      
      Fix this race, in __nf_conntrack_confirm(), by removing the CT
      from unconfirmed list before checking the DYING bit. In case
      race occured, re-add the CT to the dying list
      
      This patch also changes the verdict from NF_ACCEPT to NF_DROP when
      we lose race. Basically, the confirmation happens for the first packet
      that we see in a flow. If you just invoked conntrack -F once (which
      should be the common case), then this is likely to be the first packet
      of the flow (unless you already called flush anytime soon in the past).
      This should be hard to trigger, but better drop this packet, otherwise
      we leave things in inconsistent state since the destination will likely
      reply to this packet, but it will find no conntrack, unless the origin
      retransmits.
      
      The change of the verdict has been discussed in:
      https://www.marc.info/?l=linux-netdev&m=141588039530056&w=2Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      8ca3f5e9
  2. 23 12月, 2014 1 次提交
  3. 10 12月, 2014 2 次提交
  4. 03 12月, 2014 6 次提交
  5. 27 11月, 2014 3 次提交
  6. 26 11月, 2014 1 次提交
  7. 20 11月, 2014 2 次提交
  8. 17 11月, 2014 3 次提交
  9. 15 11月, 2014 1 次提交
  10. 14 11月, 2014 3 次提交
  11. 13 11月, 2014 2 次提交
    • P
      netfilter: nfnetlink_log: remove unnecessary error messages · 82251615
      Pablo Neira Ayuso 提交于
      In case of OOM, there's nothing userspace can do.
      
      If there's no room to put the payload in __build_packet_message(),
      jump to nla_put_failure which already performs the corresponding
      error reporting.
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      82251615
    • F
      netfilter: fix various sparse warnings · 56768644
      Florian Westphal 提交于
      net/bridge/br_netfilter.c:870:6: symbol 'br_netfilter_enable' was not declared. Should it be static?
        no; add include
      net/ipv4/netfilter/nft_reject_ipv4.c:22:6: symbol 'nft_reject_ipv4_eval' was not declared. Should it be static?
        yes
      net/ipv6/netfilter/nf_reject_ipv6.c:16:6: symbol 'nf_send_reset6' was not declared. Should it be static?
        no; add include
      net/ipv6/netfilter/nft_reject_ipv6.c:22:6: symbol 'nft_reject_ipv6_eval' was not declared. Should it be static?
        yes
      net/netfilter/core.c:33:32: symbol 'nf_ipv6_ops' was not declared. Should it be static?
        no; add include
      net/netfilter/xt_DSCP.c:40:57: cast truncates bits from constant value (ffffff03 becomes 3)
      net/netfilter/xt_DSCP.c:57:59: cast truncates bits from constant value (ffffff03 becomes 3)
        add __force, 3 is what we want.
      net/ipv4/netfilter/nf_log_arp.c:77:6: symbol 'nf_log_arp_packet' was not declared. Should it be static?
        yes
      net/ipv4/netfilter/nf_reject_ipv4.c:17:6: symbol 'nf_send_reset' was not declared. Should it be static?
        no; add include
      Signed-off-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      56768644
  12. 12 11月, 2014 7 次提交
    • P
      netfilter: nf_tables: restore synchronous object release from commit/abort · b326dd37
      Pablo Neira Ayuso 提交于
      The existing xtables matches and targets, when used from nft_compat, may
      sleep from the destroy path, ie. when removing rules. Since the objects
      are released via call_rcu from softirq context, this results in lockdep
      splats and possible lockups that may be hard to reproduce.
      
      Patrick also indicated that delayed object release via call_rcu can
      cause us problems in the ordering of event notifications when anonymous
      sets are in place.
      
      So, this patch restores the synchronous object release from the commit
      and abort paths. This includes a call to synchronize_rcu() to make sure
      that no packets are walking on the objects that are going to be
      released. This is slowier though, but it's simple and it resolves the
      aforementioned problems.
      
      This is a partial revert of c7c32e72 ("netfilter: nf_tables: defer all
      object release via rcu") that was introduced in 3.16 to speed up
      interaction with userspace.
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      b326dd37
    • P
      netfilter: nft_compat: use the match->table to validate dependencies · afefb6f9
      Pablo Neira Ayuso 提交于
      Instead of the match->name, which is of course not relevant.
      
      Fixes: f3f5dded ("netfilter: nft_compat: validate chain type in match/target")
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      afefb6f9
    • P
      netfilter: nft_compat: relax chain type validation · c918687f
      Pablo Neira Ayuso 提交于
      Check for nat chain dependency only, which is the one that can
      actually crash the kernel. Don't care if mangle, filter and security
      specific match and targets are used out of their scope, they are
      harmless.
      
      This restores iptables-compat with mangle specific match/target when
      used out of the OUTPUT chain, that are actually emulated through filter
      chains, which broke when performing strict validation.
      
      Fixes: f3f5dded ("netfilter: nft_compat: validate chain type in match/target")
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      c918687f
    • P
      netfilter: nft_compat: use current net namespace · 2daf1b4d
      Pablo Neira Ayuso 提交于
      Instead of init_net when using xtables over nftables compat.
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      2daf1b4d
    • P
      netfilter: nft_redir: fix sparse warnings · baf4750d
      Pablo Neira Ayuso 提交于
      >> net/netfilter/nft_redir.c:39:26: sparse: incorrect type in assignment (different base types)
         net/netfilter/nft_redir.c:39:26:    expected unsigned int [unsigned] [usertype] nla_be32
         net/netfilter/nft_redir.c:39:26:    got restricted __be32
      >> net/netfilter/nft_redir.c:40:40: sparse: cast to restricted __be32
      >> net/netfilter/nft_redir.c:40:40: sparse: cast to restricted __be32
      >> net/netfilter/nft_redir.c:40:40: sparse: cast to restricted __be32
      >> net/netfilter/nft_redir.c:40:40: sparse: cast to restricted __be32
      >> net/netfilter/nft_redir.c:40:40: sparse: cast to restricted __be32
      >> net/netfilter/nft_redir.c:40:40: sparse: cast to restricted __be32
      >> net/netfilter/nft_redir.c:46:34: sparse: incorrect type in assignment (different base types)
         net/netfilter/nft_redir.c:46:34:    expected unsigned int [unsigned] [usertype] nla_be32
         net/netfilter/nft_redir.c:46:34:    got restricted __be32
      >> net/netfilter/nft_redir.c:47:48: sparse: cast to restricted __be32
      >> net/netfilter/nft_redir.c:47:48: sparse: cast to restricted __be32
      >> net/netfilter/nft_redir.c:47:48: sparse: cast to restricted __be32
      >> net/netfilter/nft_redir.c:47:48: sparse: cast to restricted __be32
      >> net/netfilter/nft_redir.c:47:48: sparse: cast to restricted __be32
      >> net/netfilter/nft_redir.c:47:48: sparse: cast to restricted __be32
      
      Fixes: e9105f1b ("netfilter: nf_tables: add new expression nft_redir")
      Reported-by: Nkbuild test robot <fengguang.wu@intel.com>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      baf4750d
    • P
      netfilter: fix unmet dependencies in NETFILTER_XT_TARGET_REDIRECT · f6c6339d
      Pablo Neira Ayuso 提交于
      warning: (NETFILTER_XT_TARGET_REDIRECT) selects NF_NAT_REDIRECT_IPV4 which has unmet direct dependencies (NET && INET && NETFILTER && NF_NAT_IPV4)
      
      warning: (NETFILTER_XT_TARGET_REDIRECT) selects NF_NAT_REDIRECT_IPV6 which has unmet direct dependencies (NET && INET && IPV6 && NETFILTER && NF_NAT_IPV6)
      
      Fixes: 8b13eddf ("netfilter: refactor NAT redirect IPv4 to use it from nf_tables")
      Fixes: 9de920ed ("netfilter: refactor NAT redirect IPv6 code to use it from nf_tables")
      Reported-by: Nkbuild test robot <fengguang.wu@intel.com>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      f6c6339d
    • C
      ipvs: Keep skb->sk when allocating headroom on tunnel xmit · 50656d9d
      Calvin Owens 提交于
      ip_vs_prepare_tunneled_skb() ignores ->sk when allocating a new
      skb, either unconditionally setting ->sk to NULL or allowing
      the uninitialized ->sk from a newly allocated skb to leak through
      to the caller.
      
      This patch properly copies ->sk and increments its reference count.
      Signed-off-by: NCalvin Owens <calvinowens@fb.com>
      Acked-by: NJulian Anastasov <ja@ssi.bg>
      Signed-off-by: NSimon Horman <horms@verge.net.au>
      50656d9d
  13. 11 11月, 2014 1 次提交
  14. 09 11月, 2014 1 次提交
  15. 06 11月, 2014 3 次提交
  16. 05 11月, 2014 1 次提交