1. 13 6月, 2008 1 次提交
    • D
      tcp: Revert 'process defer accept as established' changes. · ec0a1966
      David S. Miller 提交于
      This reverts two changesets, ec3c0982
      ("[TCP]: TCP_DEFER_ACCEPT updates - process as established") and
      the follow-on bug fix 9ae27e0a
      ("tcp: Fix slab corruption with ipv6 and tcp6fuzz").
      
      This change causes several problems, first reported by Ingo Molnar
      as a distcc-over-loopback regression where connections were getting
      stuck.
      
      Ilpo Järvinen first spotted the locking problems.  The new function
      added by this code, tcp_defer_accept_check(), only has the
      child socket locked, yet it is modifying state of the parent
      listening socket.
      
      Fixing that is non-trivial at best, because we can't simply just grab
      the parent listening socket lock at this point, because it would
      create an ABBA deadlock.  The normal ordering is parent listening
      socket --> child socket, but this code path would require the
      reverse lock ordering.
      
      Next is a problem noticed by Vitaliy Gusev, he noted:
      
      ----------------------------------------
      >--- a/net/ipv4/tcp_timer.c
      >+++ b/net/ipv4/tcp_timer.c
      >@@ -481,6 +481,11 @@ static void tcp_keepalive_timer (unsigned long data)
      > 		goto death;
      > 	}
      >
      >+	if (tp->defer_tcp_accept.request && sk->sk_state == TCP_ESTABLISHED) {
      >+		tcp_send_active_reset(sk, GFP_ATOMIC);
      >+		goto death;
      
      Here socket sk is not attached to listening socket's request queue. tcp_done()
      will not call inet_csk_destroy_sock() (and tcp_v4_destroy_sock() which should
      release this sk) as socket is not DEAD. Therefore socket sk will be lost for
      freeing.
      ----------------------------------------
      
      Finally, Alexey Kuznetsov argues that there might not even be any
      real value or advantage to these new semantics even if we fix all
      of the bugs:
      
      ----------------------------------------
      Hiding from accept() sockets with only out-of-order data only
      is the only thing which is impossible with old approach. Is this really
      so valuable? My opinion: no, this is nothing but a new loophole
      to consume memory without control.
      ----------------------------------------
      
      So revert this thing for now.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ec0a1966
  2. 11 6月, 2008 2 次提交
  3. 05 6月, 2008 7 次提交
  4. 04 6月, 2008 1 次提交
  5. 23 5月, 2008 1 次提交
  6. 20 5月, 2008 1 次提交
  7. 17 5月, 2008 1 次提交
    • I
      mac80211: Add RTNL version of ieee80211_iterate_active_interfaces · 2f561feb
      Ivo van Doorn 提交于
      Since commit e38bad47
      	mac80211: make ieee80211_iterate_active_interfaces not need rtnl
      rt2500usb and rt73usb broke down due to attempting register access
      in atomic context (which is not possible for USB hardware).
      
      This patch restores ieee80211_iterate_active_interfaces() to use RTNL lock,
      and provides the non-RTNL version under a new name:
      	ieee80211_iterate_active_interfaces_atomic()
      
      So far only rt2x00 uses ieee80211_iterate_active_interfaces(), and those
      drivers require the RTNL version of ieee80211_iterate_active_interfaces().
      Since they already call that function directly, this patch will automatically
      fix the USB rt2x00 drivers.
      
      v2: Rename ieee80211_iterate_active_interfaces_rtnl
      Signed-off-by: NIvo van Doorn <IvDoorn@gmail.com>
      Acked-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      2f561feb
  8. 15 5月, 2008 2 次提交
    • E
      9p: fix error path during early mount · 887b3ece
      Eric Van Hensbergen 提交于
      There was some cleanup issues during early mount which would trigger
      a kernel bug for certain types of failure.  This patch reorganizes the
      cleanup to get rid of the bad behavior.
      
      This also merges the 9pnet and 9pnet_fd modules for the purpose of
      configuration and initialization.  Keeping the fd transport separate
      from the core 9pnet code seemed like a good idea at the time, but in
      practice has caused more harm and confusion than good.
      Signed-off-by: NEric Van Hensbergen <ericvh@gmail.com>
      887b3ece
    • E
      9p: Documentation updates · ee443996
      Eric Van Hensbergen 提交于
      The kernel-doc comments of much of the 9p system have been in disarray since
      reorganization.  This patch fixes those problems, adds additional documentation
      and a template book which collects the 9p information.
      Signed-off-by: NEric Van Hensbergen <ericvh@gmail.com>
      ee443996
  9. 14 5月, 2008 1 次提交
  10. 12 5月, 2008 1 次提交
    • D
      syncppp: Fix crashes. · 4951704b
      David S. Miller 提交于
      The syncppp layer wants a mid-level netdev private pointer.
      
      It was using netdev->priv but that only worked by accident,
      and thus this scheme was broken when the device private
      allocation strategy changed.
      
      Add a proper mid-layer private pointer for uses like this,
      update syncppp and all users, and remove the HDLC_PPP broken
      tag from drivers/net/wan/Kconfig
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4951704b
  11. 05 5月, 2008 1 次提交
  12. 04 5月, 2008 1 次提交
    • M
      xfrm: convert empty xfrm_audit_* macros to functions · 41fef0ee
      Marcin Slusarz 提交于
      it removes these warnings when CONFIG_AUDITSYSCALL is unset:
      
      net/xfrm/xfrm_user.c: In function 'xfrm_add_sa':
      net/xfrm/xfrm_user.c:412: warning: unused variable 'sid'
      net/xfrm/xfrm_user.c:411: warning: unused variable 'sessionid'
      net/xfrm/xfrm_user.c:410: warning: unused variable 'loginuid'
      net/xfrm/xfrm_user.c: In function 'xfrm_del_sa':
      net/xfrm/xfrm_user.c:485: warning: unused variable 'sid'
      net/xfrm/xfrm_user.c:484: warning: unused variable 'sessionid'
      net/xfrm/xfrm_user.c:483: warning: unused variable 'loginuid'
      net/xfrm/xfrm_user.c: In function 'xfrm_add_policy':
      net/xfrm/xfrm_user.c:1132: warning: unused variable 'sid'
      net/xfrm/xfrm_user.c:1131: warning: unused variable 'sessionid'
      net/xfrm/xfrm_user.c:1130: warning: unused variable 'loginuid'
      net/xfrm/xfrm_user.c: In function 'xfrm_get_policy':
      net/xfrm/xfrm_user.c:1382: warning: unused variable 'sid'
      net/xfrm/xfrm_user.c:1381: warning: unused variable 'sessionid'
      net/xfrm/xfrm_user.c:1380: warning: unused variable 'loginuid'
      net/xfrm/xfrm_user.c: In function 'xfrm_add_pol_expire':
      net/xfrm/xfrm_user.c:1620: warning: unused variable 'sid'
      net/xfrm/xfrm_user.c:1619: warning: unused variable 'sessionid'
      net/xfrm/xfrm_user.c:1618: warning: unused variable 'loginuid'
      net/xfrm/xfrm_user.c: In function 'xfrm_add_sa_expire':
      net/xfrm/xfrm_user.c:1658: warning: unused variable 'sid'
      net/xfrm/xfrm_user.c:1657: warning: unused variable 'sessionid'
      net/xfrm/xfrm_user.c:1656: warning: unused variable 'loginuid'
      Signed-off-by: NMarcin Slusarz <marcin.slusarz@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      41fef0ee
  13. 29 4月, 2008 4 次提交
  14. 28 4月, 2008 2 次提交
  15. 24 4月, 2008 1 次提交
  16. 22 4月, 2008 1 次提交
    • H
      [IPSEC]: Fix catch-22 with algorithm IDs above 31 · c5d18e98
      Herbert Xu 提交于
      As it stands it's impossible to use any authentication algorithms
      with an ID above 31 portably.  It just happens to work on x86 but
      fails miserably on ppc64.
      
      The reason is that we're using a bit mask to check the algorithm
      ID but the mask is only 32 bits wide.
      
      After looking at how this is used in the field, I have concluded
      that in the long term we should phase out state matching by IDs
      because this is made superfluous by the reqid feature.  For current
      applications, the best solution IMHO is to allow all algorithms when
      the bit masks are all ~0.
      
      The following patch does exactly that.
      
      This bug was identified by IBM when testing on the ppc64 platform
      using the NULL authentication algorithm which has an ID of 251.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c5d18e98
  17. 18 4月, 2008 2 次提交
  18. 17 4月, 2008 1 次提交
  19. 16 4月, 2008 5 次提交
  20. 15 4月, 2008 4 次提交
    • P
      [NETNS]: The generic per-net pointers. · dec827d1
      Pavel Emelyanov 提交于
      Add the elastic array of void * pointer to the struct net.
      The access rules are simple:
      
       1. register the ops with register_pernet_gen_device to get
          the id of your private pointer
       2. call net_assign_generic() to put the private data on the
          struct net (most preferably this should be done in the
          ->init callback of the ops registered)
       3. do not store any private reference on the net_generic array;
       4. do not change this pointer while the net is alive;
       5. use the net_generic() to get the pointer.
      
      When adding a new pointer, I copy the old array, replace it
      with a new one and schedule the old for kfree after an RCU
      grace period.
      
      Since the net_generic explores the net->gen array inside rcu
      read section and once set the net->gen->ptr[x] pointer never 
      changes, this grants us a safe access to generic pointers.
      
      Quoting Paul: "... RCU is protecting -only- the net_generic 
      structure that net_generic() is traversing, and the [pointer]
      returned by net_generic() is protected by a reference counter 
      in the upper-level struct net."
      Signed-off-by: NPavel Emelyanov <xemul@openvz.org>
      Acked-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      dec827d1
    • P
      [NETNS]: The net-subsys IDs generator. · c93cf61f
      Pavel Emelyanov 提交于
      To make some per-net generic pointers, we need some way to address
      them, i.e. - IDs. This is simple IDA-based IDs generator for pernet
      subsystems.
      
      Addressing questions about potential checkpoint/restart problems: 
      these IDs are "lite-offsets" within the net structure and are by no 
      means supposed to be exported to the userspace.
      
      Since it will be used in the nearest future by devices only (tun,
      vlan, tunnels, bridge, etc), I make it resemble the functionality
      of register_pernet_device().
      
      The new ids is stored in the *id pointer _before_ calling the init
      callback to make this id available in this callback.
      Signed-off-by: NPavel Emelyanov <xemul@openvz.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c93cf61f
    • A
      [IRDA]: Remove irlan_eth_send_gratuitous_arp() · 7ef3abd2
      Adrian Bunk 提交于
      Even kernel 2.2.26 (sic) already contains the
        #undef CONFIG_IRLAN_SEND_GRATUITOUS_ARP
      with the comment "but for some reason the machine crashes if you use DHCP".
      
      Either someone finally looks into this or it's simply time to remove 
      this dead code.
      Reported-by: NRobert P. J. Day <rpjday@crashcourse.ca>
      Signed-off-by: NAdrian Bunk <bunk@kernel.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7ef3abd2
    • A
      [TIPC]: Overhaul of socket locking logic · 0c3141e9
      Allan Stephens 提交于
      This patch modifies TIPC's socket code to follow the same approach
      used by other protocols.  This change eliminates the need for a
      mutex in the TIPC-specific portion of the socket protocol data
      structure -- in its place, the standard Linux socket backlog queue
      and associated locking routines are utilized.  These changes fix
      a long-standing receive queue bug on SMP systems, and also enable
      individual read and write threads to utilize a socket without
      unnecessarily interfering with each other.
      Signed-off-by: NAllan Stephens <allan.stephens@windriver.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0c3141e9