1. 17 9月, 2009 2 次提交
  2. 15 9月, 2009 1 次提交
  3. 10 7月, 2009 1 次提交
    • J
      net: adding memory barrier to the poll and receive callbacks · a57de0b4
      Jiri Olsa 提交于
      Adding memory barrier after the poll_wait function, paired with
      receive callbacks. Adding fuctions sock_poll_wait and sk_has_sleeper
      to wrap the memory barrier.
      
      Without the memory barrier, following race can happen.
      The race fires, when following code paths meet, and the tp->rcv_nxt
      and __add_wait_queue updates stay in CPU caches.
      
      CPU1                         CPU2
      
      sys_select                   receive packet
        ...                        ...
        __add_wait_queue           update tp->rcv_nxt
        ...                        ...
        tp->rcv_nxt check          sock_def_readable
        ...                        {
        schedule                      ...
                                      if (sk->sk_sleep && waitqueue_active(sk->sk_sleep))
                                              wake_up_interruptible(sk->sk_sleep)
                                      ...
                                   }
      
      If there was no cache the code would work ok, since the wait_queue and
      rcv_nxt are opposit to each other.
      
      Meaning that once tp->rcv_nxt is updated by CPU2, the CPU1 either already
      passed the tp->rcv_nxt check and sleeps, or will get the new value for
      tp->rcv_nxt and will return with new data mask.
      In both cases the process (CPU1) is being added to the wait queue, so the
      waitqueue_active (CPU2) call cannot miss and will wake up CPU1.
      
      The bad case is when the __add_wait_queue changes done by CPU1 stay in its
      cache, and so does the tp->rcv_nxt update on CPU2 side.  The CPU1 will then
      endup calling schedule and sleep forever if there are no more data on the
      socket.
      
      Calls to poll_wait in following modules were ommited:
      	net/bluetooth/af_bluetooth.c
      	net/irda/af_irda.c
      	net/irda/irnet/irnet_ppp.c
      	net/mac80211/rc80211_pid_debugfs.c
      	net/phonet/socket.c
      	net/rds/af_rds.c
      	net/rfkill/core.c
      	net/sunrpc/cache.c
      	net/sunrpc/rpc_pipe.c
      	net/tipc/socket.c
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a57de0b4
  4. 19 6月, 2009 2 次提交
  5. 16 6月, 2009 1 次提交
  6. 23 4月, 2009 8 次提交
  7. 22 4月, 2009 5 次提交
  8. 27 2月, 2009 1 次提交
  9. 06 1月, 2009 3 次提交
  10. 25 12月, 2008 1 次提交
  11. 14 7月, 2008 1 次提交
  12. 10 6月, 2008 1 次提交
  13. 10 4月, 2008 1 次提交
  14. 08 2月, 2008 2 次提交
  15. 29 1月, 2008 1 次提交
  16. 01 11月, 2007 1 次提交
  17. 11 10月, 2007 3 次提交
    • U
      [AF_IUCV]: postpone receival of iucv-packets · f0703c80
      Ursula Braun 提交于
      AF_IUCV socket programs may waste Linux storage, because af_iucv
      allocates an skb whenever posted by the receive callback routine and
      receives the message immediately.
      Message receival is now postponed if data from previous callbacks has
      not yet been transferred to the receiving socket program. Instead a
      message handle is saved in a message queue as a reminder. Once
      messages could be given to the receiving socket program, there is
      an additional checking for entries in the message queue, followed
      by skb allocation and message receival if applicable.
      Signed-off-by: NUrsula Braun <braunu@de.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f0703c80
    • H
    • E
      [NET]: Make socket creation namespace safe. · 1b8d7ae4
      Eric W. Biederman 提交于
      This patch passes in the namespace a new socket should be created in
      and has the socket code do the appropriate reference counting.  By
      virtue of this all socket create methods are touched.  In addition
      the socket create methods are modified so that they will fail if
      you attempt to create a socket in a non-default network namespace.
      
      Failing if we attempt to create a socket outside of the default
      network namespace ensures that as we incrementally make the network stack
      network namespace aware we will not export functionality that someone
      has not audited and made certain is network namespace safe.
      Allowing us to partially enable network namespaces before all of the
      exotic protocols are supported.
      
      Any protocol layers I have missed will fail to compile because I now
      pass an extra parameter into the socket creation code.
      
      [ Integrated AF_IUCV build fixes from Andrew Morton... -DaveM ]
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1b8d7ae4
  18. 15 7月, 2007 1 次提交
  19. 06 5月, 2007 1 次提交
  20. 05 5月, 2007 2 次提交
  21. 26 4月, 2007 1 次提交