1. 06 11月, 2013 1 次提交
    • J
      net: Explicitly initialize u64_stats_sync structures for lockdep · 827da44c
      John Stultz 提交于
      In order to enable lockdep on seqcount/seqlock structures, we
      must explicitly initialize any locks.
      
      The u64_stats_sync structure, uses a seqcount, and thus we need
      to introduce a u64_stats_init() function and use it to initialize
      the structure.
      
      This unfortunately adds a lot of fairly trivial initialization code
      to a number of drivers. But the benefit of ensuring correctness makes
      this worth while.
      
      Because these changes are required for lockdep to be enabled, and the
      changes are quite trivial, I've not yet split this patch out into 30-some
      separate patches, as I figured it would be better to get the various
      maintainers thoughts on how to best merge this change along with
      the seqcount lockdep enablement.
      
      Feedback would be appreciated!
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      Acked-by: NJulian Anastasov <ja@ssi.bg>
      Signed-off-by: NPeter Zijlstra <peterz@infradead.org>
      Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
      Cc: James Morris <jmorris@namei.org>
      Cc: Jesse Gross <jesse@nicira.com>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Mirko Lindner <mlindner@marvell.com>
      Cc: Patrick McHardy <kaber@trash.net>
      Cc: Roger Luethi <rl@hellgate.ch>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Simon Horman <horms@verge.net.au>
      Cc: Stephen Hemminger <stephen@networkplumber.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Cc: Wensong Zhang <wensong@linux-vs.org>
      Cc: netdev@vger.kernel.org
      Link: http://lkml.kernel.org/r/1381186321-4906-2-git-send-email-john.stultz@linaro.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
      827da44c
  2. 22 10月, 2013 2 次提交
  3. 20 10月, 2013 2 次提交
  4. 12 10月, 2013 1 次提交
  5. 09 10月, 2013 1 次提交
  6. 08 10月, 2013 1 次提交
  7. 03 10月, 2013 1 次提交
  8. 02 10月, 2013 2 次提交
  9. 01 10月, 2013 3 次提交
    • S
      ipv6 mcast: use in6_dev_put in timer handlers instead of __in6_dev_put · 9260d3e1
      Salam Noureddine 提交于
      It is possible for the timer handlers to run after the call to
      ipv6_mc_down so use in6_dev_put instead of __in6_dev_put in the
      handler function in order to do proper cleanup when the refcnt
      reaches 0. Otherwise, the refcnt can reach zero without the
      inet6_dev being destroyed and we end up leaking a reference to
      the net_device and see messages like the following,
      
      unregister_netdevice: waiting for eth0 to become free. Usage count = 1
      
      Tested on linux-3.4.43.
      Signed-off-by: NSalam Noureddine <noureddine@aristanetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9260d3e1
    • H
      ipv6: gre: correct calculation of max_headroom · 3da812d8
      Hannes Frederic Sowa 提交于
      gre_hlen already accounts for sizeof(struct ipv6_hdr) + gre header,
      so initialize max_headroom to zero. Otherwise the
      
      	if (encap_limit >= 0) {
      		max_headroom += 8;
      		mtu -= 8;
      	}
      
      increments an uninitialized variable before max_headroom was reset.
      
      Found with coverity: 728539
      
      Cc: Dmitry Kozlov <xeb@mail.ru>
      Signed-off-by: NHannes Frederic Sowa <hannes@stressinduktion.org>
      Acked-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3da812d8
    • P
      ipv6: Fix preferred_lft not updating in some cases · c9d55d5b
      Paul Marks 提交于
      Consider the scenario where an IPv6 router is advertising a fixed
      preferred_lft of 1800 seconds, while the valid_lft begins at 3600
      seconds and counts down in realtime.
      
      A client should reset its preferred_lft to 1800 every time the RA is
      received, but a bug is causing Linux to ignore the update.
      
      The core problem is here:
        if (prefered_lft != ifp->prefered_lft) {
      
      Note that ifp->prefered_lft is an offset, so it doesn't decrease over
      time.  Thus, the comparison is always (1800 != 1800), which fails to
      trigger an update.
      
      The most direct solution would be to compute a "stored_prefered_lft",
      and use that value in the comparison.  But I think that trying to filter
      out unnecessary updates here is a premature optimization.  In order for
      the filter to apply, both of these would need to hold:
      
        - The advertised valid_lft and preferred_lft are both declining in
          real time.
        - No clock skew exists between the router & client.
      
      So in this patch, I've set "update_lft = 1" unconditionally, which
      allows the surrounding code to be greatly simplified.
      Signed-off-by: NPaul Marks <pmarks@google.com>
      Acked-by: NHannes Frederic Sowa <hannes@stressinduktion.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c9d55d5b
  10. 30 9月, 2013 1 次提交
  11. 29 9月, 2013 1 次提交
  12. 24 9月, 2013 3 次提交
  13. 17 9月, 2013 1 次提交
  14. 16 9月, 2013 2 次提交
  15. 13 9月, 2013 1 次提交
  16. 12 9月, 2013 4 次提交
  17. 06 9月, 2013 1 次提交
    • D
      ipv6:introduce function to find route for redirect · b55b76b2
      Duan Jiong 提交于
      RFC 4861 says that the IP source address of the Redirect is the
      same as the current first-hop router for the specified ICMP
      Destination Address, so the gateway should be taken into
      consideration when we find the route for redirect.
      
      There was once a check in commit
      a6279458 ("NDISC: Search over
      all possible rules on receipt of redirect.") and the check
      went away in commit b94f1c09
      ("ipv6: Use icmpv6_notify() to propagate redirect, instead of
      rt6_redirect()").
      
      The bug is only "exploitable" on layer-2 because the source
      address of the redirect is checked to be a valid link-local
      address but it makes spoofing a lot easier in the same L2
      domain nonetheless.
      
      Thanks very much for Hannes's help.
      Signed-off-by: NDuan Jiong <duanj.fnst@cn.fujitsu.com>
      Acked-by: NHannes Frederic Sowa <hannes@stressinduktion.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b55b76b2
  18. 05 9月, 2013 10 次提交
  19. 04 9月, 2013 2 次提交
    • J
      netfilter: SYNPROXY: let unrelated packets continue · 7cc9eb6e
      Jesper Dangaard Brouer 提交于
      Packets reaching SYNPROXY were default dropped, as they were most
      likely invalid (given the recommended state matching).  This
      patch, changes SYNPROXY target to let packets, not consumed,
      continue being processed by the stack.
      
      This will be more in line other target modules. As it will allow
      more flexible configurations of handling, logging or matching on
      packets in INVALID states.
      Signed-off-by: NJesper Dangaard Brouer <brouer@redhat.com>
      Acked-by: NPatrick McHardy <kaber@trash.net>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      7cc9eb6e
    • J
      netfilter: more strict TCP flag matching in SYNPROXY · 775ada6d
      Jesper Dangaard Brouer 提交于
      Its seems Patrick missed to incoorporate some of my requested changes
      during review v2 of SYNPROXY netfilter module.
      
      Which were, to avoid SYN+ACK packets to enter the path, meant for the
      ACK packet from the client (from the 3WHS).
      
      Further there were a bug in ip6t_SYNPROXY.c, for matching SYN packets
      that didn't exclude the ACK flag.
      
      Go a step further with SYN packet/flag matching by excluding flags
      ACK+FIN+RST, in both IPv4 and IPv6 modules.
      
      The intented usage of SYNPROXY is as follows:
      (gracefully describing usage in commit)
      
       iptables -t raw -A PREROUTING -i eth0 -p tcp --dport 80 --syn -j NOTRACK
       iptables -A INPUT -i eth0 -p tcp --dport 80 -m state UNTRACKED,INVALID \
               -j SYNPROXY --sack-perm --timestamp --mss 1480 --wscale 7 --ecn
      
       echo 0 > /proc/sys/net/netfilter/nf_conntrack_tcp_loose
      
      This does filter SYN flags early, for packets in the UNTRACKED state,
      but packets in the INVALID state with other TCP flags could still
      reach the module, thus this stricter flag matching is still needed.
      Signed-off-by: NJesper Dangaard Brouer <brouer@redhat.com>
      Acked-by: NPatrick McHardy <kaber@trash.net>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      775ada6d