1. 24 May, 2011 6 commits
    • Dmitry Kravkov's avatar
      eb722d7a
    • Veaceslav Falico's avatar
      igmp: call ip_mc_clear_src() only when we have no users of ip_mc_list · 24cf3af3
      Veaceslav Falico authored
      In igmp_group_dropped() we call ip_mc_clear_src(), which resets the number
      of source filters per mulitcast. However, igmp_group_dropped() is also
      called on NETDEV_DOWN, NETDEV_PRE_TYPE_CHANGE and NETDEV_UNREGISTER, which
      means that the group might get added back on NETDEV_UP, NETDEV_REGISTER and
      NETDEV_POST_TYPE_CHANGE respectively, leaving us with broken source
      filters.
      
      To fix that, we must clear the source filters only when there are no users
      in the ip_mc_list, i.e. in ip_mc_dec_group() and on device destroy.
      Acked-by: default avatarDavid L Stevens <dlstevens@us.ibm.com>
      Signed-off-by: default avatarVeaceslav Falico <vfalico@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      24cf3af3
    • Eric Dumazet's avatar
      net: use synchronize_rcu_expedited() · be3fc413
      Eric Dumazet authored
      synchronize_rcu() is very slow in various situations (HZ=100,
      CONFIG_NO_HZ=y, CONFIG_PREEMPT=n)
      
      Extract from my (mostly idle) 8 core machine :
      
       synchronize_rcu() in 99985 us
       synchronize_rcu() in 79982 us
       synchronize_rcu() in 87612 us
       synchronize_rcu() in 79827 us
       synchronize_rcu() in 109860 us
       synchronize_rcu() in 98039 us
       synchronize_rcu() in 89841 us
       synchronize_rcu() in 79842 us
       synchronize_rcu() in 80151 us
       synchronize_rcu() in 119833 us
       synchronize_rcu() in 99858 us
       synchronize_rcu() in 73999 us
       synchronize_rcu() in 79855 us
       synchronize_rcu() in 79853 us
      
      When we hold RTNL mutex, we would like to spend some cpu cycles but not
      block too long other processes waiting for this mutex.
      
      We also want to setup/dismantle network features as fast as possible at
      boot/shutdown time.
      
      This patch makes synchronize_net() call the expedited version if RTNL is
      locked.
      
      synchronize_rcu_expedited() typical delay is about 20 us on my machine.
      
       synchronize_rcu_expedited() in 18 us
       synchronize_rcu_expedited() in 18 us
       synchronize_rcu_expedited() in 18 us
       synchronize_rcu_expedited() in 18 us
       synchronize_rcu_expedited() in 20 us
       synchronize_rcu_expedited() in 16 us
       synchronize_rcu_expedited() in 20 us
       synchronize_rcu_expedited() in 18 us
       synchronize_rcu_expedited() in 18 us
      Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      CC: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      CC: Ben Greear <greearb@candelatech.com>
      Reviewed-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      be3fc413
    • Dan Rosenberg's avatar
      net: convert %p usage to %pK · 71338aa7
      Dan Rosenberg authored
      The %pK format specifier is designed to hide exposed kernel pointers,
      specifically via /proc interfaces.  Exposing these pointers provides an
      easy target for kernel write vulnerabilities, since they reveal the
      locations of writable structures containing easily triggerable function
      pointers.  The behavior of %pK depends on the kptr_restrict sysctl.
      
      If kptr_restrict is set to 0, no deviation from the standard %p behavior
      occurs.  If kptr_restrict is set to 1, the default, if the current user
      (intended to be a reader via seq_printf(), etc.) does not have CAP_SYSLOG
      (currently in the LSM tree), kernel pointers using %pK are printed as 0's.
       If kptr_restrict is set to 2, kernel pointers using %pK are printed as
      0's regardless of privileges.  Replacing with 0's was chosen over the
      default "(null)", which cannot be parsed by userland %p, which expects
      "(nil)".
      
      The supporting code for kptr_restrict and %pK are currently in the -mm
      tree.  This patch converts users of %p in net/ to %pK.  Cases of printing
      pointers to the syslog are not covered, since this would eliminate useful
      information for postmortem debugging and the reading of the syslog is
      already optionally protected by the dmesg_restrict sysctl.
      Signed-off-by: default avatarDan Rosenberg <drosenberg@vsecurity.com>
      Cc: James Morris <jmorris@namei.org>
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      Cc: Thomas Graf <tgraf@infradead.org>
      Cc: Eugene Teo <eugeneteo@kernel.org>
      Cc: Kees Cook <kees.cook@canonical.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Eric Paris <eparis@parisplace.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      71338aa7
    • Mike Frysinger's avatar
      net/irda: convert bfin_sir to common Blackfin UART header · 229de618
      Mike Frysinger authored
      No need to duplicate these defines now that the common Blackfin code has
      unified these for all UART devices.
      Signed-off-by: default avatarMike Frysinger <vapier@gentoo.org>
      Cc: Samuel Ortiz <samuel@sortiz.org>
      Cc: David Miller <davem@davemloft.net>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      229de618
    • David S. Miller's avatar
      ipv6: Fix return of xfrm6_tunnel_rcv() · 6ac3f664
      David S. Miller authored
      Like ipv4, just return xfrm6_rcv_spi()'s return value directly.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6ac3f664
  2. 23 May, 2011 34 commits