1. 16 1月, 2010 1 次提交
    • E
      inotify: do not reuse watch descriptors · 9e572cc9
      Eric Paris 提交于
      Since commit 7e790dd5 ("inotify: fix
      error paths in inotify_update_watch") inotify changed the manor in which
      it gave watch descriptors back to userspace.  Previous to this commit
      inotify acted like the following:
      
        inotify_add_watch(X, Y, Z) = 1
        inotify_rm_watch(X, 1);
        inotify_add_watch(X, Y, Z) = 2
      
      but after this patch inotify would return watch descriptors like so:
      
        inotify_add_watch(X, Y, Z) = 1
        inotify_rm_watch(X, 1);
        inotify_add_watch(X, Y, Z) = 1
      
      which I saw as equivalent to opening an fd where
      
        open(file) = 1;
        close(1);
        open(file) = 1;
      
      seemed perfectly reasonable.  The issue is that quite a bit of userspace
      apparently relies on the behavior in which watch descriptors will not be
      quickly reused.  KDE relies on it, I know some selinux packages rely on
      it, and I have heard complaints from other random sources such as debian
      bug 558981.
      
      Although the man page implies what we do is ok, we broke userspace so
      this patch almost reverts us to the old behavior.  It is still slightly
      racey and I have patches that would fix that, but they are rather large
      and this will fix it for all real world cases.  The race is as follows:
      
       - task1 creates a watch and blocks in idr_new_watch() before it updates
         the hint.
       - task2 creates a watch and updates the hint.
       - task1 updates the hint with it's older wd
       - task removes the watch created by task2
       - task adds a new watch and will reuse the wd originally given to task2
      
      it requires moving some locking around the hint (last_wd) but this should
      solve it for the real world and be -stable safe.
      
      As a side effect this patch papers over a bug in the lib/idr code which
      is causing a large number WARN's to pop on people's system and many
      reports in kerneloops.org.  I'm working on the root cause of that idr
      bug seperately but this should make inotify immune to that issue.
      Signed-off-by: NEric Paris <eparis@redhat.com>
      Cc: stable@kernel.org
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      9e572cc9
  2. 15 1月, 2010 2 次提交
    • L
      Merge branch 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6 · 61c39bb3
      Linus Torvalds 提交于
      * 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6:
        [S390] tape_char: add missing compat_ptr conversion
        [S390] zcrypt: add sanity check before copy_from_user()
        [S390] unwire sys_recvmmsg again
        [S390] con3215: remove empty ioctl function
        [S390] dasd: add proper compat pointer conversion for symmetrix ioctl
        [S390] mmap: add missing compat_ptr conversion to both mmap compat syscalls
        [S390] bug: implement arch specific __WARN macro
        [S390] Move __cpu_logical_map to smp.c
        [S390] tape_block: remove ioctl function
        [S390] smp: remove volatile type quilifier from __cpu_logical_map
        [S390] smp: setup smp_processor_id early
        [S390] use helpers for rlimits
        [S390] fs3270: add missing compat ptr conversion
        [S390] vmcp: add missing compat ptr conversion
        [S390] cio: add missing compat ptr conversion
        [S390] dasd: add missing compat ptr conversion
        [S390] remove superfluous TIF_USEDFPU bit
        [S390] duplicate SIGTRAP on signal delivery.
        [S390] clear TIF_SINGLE_STEP for new process.
        [S390] fix loading of PER control registers for utrace.
      61c39bb3
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 · 4a24eef6
      Linus Torvalds 提交于
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (34 commits)
        net: fix build erros with CONFIG_BUG=n, CONFIG_GENERIC_BUG=n
        ipv6: skb_dst() can be NULL in ipv6_hop_jumbo().
        tg3: Update copyright and driver version
        tg3: Disable 5717 serdes and B0 support
        tg3: Add reliable serdes detection for 5717 A0
        tg3: Fix std rx prod ring handling
        tg3: Fix std prod ring nicaddr for 5787 and 57765
        sfc: Fix conditions for MDIO self-test
        sfc: Fix polling for slow MCDI operations
        e1000e: workaround link issues on busy hub in half duplex on 82577/82578
        e1000e: MDIO slow mode should always be done for 82577
        ixgbe: update copyright dates
        ixgbe: Do not attempt to perform interrupts in netpoll when down
        cfg80211: fix refcount imbalance when wext is disabled
        mac80211: fix queue selection for data frames on monitor interfaces
        iwlwifi: silence buffer overflow warning
        iwlwifi: disable tx on beacon update notification
        iwlwifi: fix iwl_queue_used bug when read_ptr == write_ptr
        mac80211: fix endian error
        mac80211: add missing sanity checks for action frames
        ...
      4a24eef6
  3. 14 1月, 2010 37 次提交