1. 27 10月, 2008 2 次提交
    • D
      epoll: avoid double-inserts in case of EFAULT · 9ce209d6
      Davide Libenzi 提交于
      In commit f337b9c5 ("epoll: drop
      unnecessary test") Thomas found that there is an unnecessary (always
      true) test in ep_send_events().  The callback never inserts into
      ->rdllink while the send loop is performed, and also does the
      ~EP_PRIVATE_BITS test.  Given we're holding the mutex during this time,
      the conditions tested inside the loop are always true.
      
      HOWEVER.
      
      The test "!ep_is_linked(&epi->rdllink)" wasn't there because we insert
      into ->rdllink, but because the send-events loop might terminate before
      the whole list is scanned (-EFAULT).
      
      In such cases, when the loop terminates early, and when a (leftover)
      file received an event while we're performing the lockless loop, we need
      such test to avoid to double insert the epoll items.  The list_splice()
      done a few steps below, will correctly re-insert the ones that were left
      on "txlist".
      
      This should fix the kenrel.org bugzilla entry 11831.
      Signed-off-by: NDavide Libenzi <davidel@xmailserver.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      9ce209d6
    • A
      select: deal with math overflow from borderline valid userland data · 4d36a9e6
      Arjan van de Ven 提交于
      Some userland apps seem to pass in a "0" for the seconds, and several
      seconds worth of usecs to select().  The old kernels accepted this just
      fine, so the new kernels must too.
      
      However, due to the upscaling of the microseconds to nanoseconds we had
      some cases where we got math overflow, and depending on the GCC version
      (due to inlining decisions) that actually resulted in an -EINVAL return.
      
      This patch fixes this by adding the excess microseconds to the seconds
      field.
      
      Also with thanks to Marcin Slusarz for spotting some implementation bugs
      in the diagnostics patches.
      Reported-by: NCarlos R. Mafra <crmafra2@gmail.com>
      Signed-off-by: NArjan van de Ven <arjan@linux.intel.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      4d36a9e6
  2. 26 10月, 2008 2 次提交
  3. 24 10月, 2008 2 次提交
  4. 23 10月, 2008 34 次提交