Skip to content
  1. Apr 25, 2011
    • Frederic Weisbecker's avatar
      sh, hw_breakpoints: Fix racy access to ptrace breakpoints · e0ac8457
      Frederic Weisbecker authored
      
      
      While the tracer accesses ptrace breakpoints, the child task may
      concurrently exit due to a SIGKILL and thus release its breakpoints
      at the same time. We can then dereference some freed pointers.
      
      To fix this, hold a reference on the child breakpoints before
      manipulating them.
      
      Reported-by: default avatarOleg Nesterov <oleg@redhat.com>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Acked-by: default avatarPaul Mundt <lethal@linux-sh.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Prasad <prasad@linux.vnet.ibm.com>
      Link: http://lkml.kernel.org/r/1302284067-7860-6-git-send-email-fweisbec@gmail.com
      e0ac8457
    • Frederic Weisbecker's avatar
      arm, hw_breakpoints: Fix racy access to ptrace breakpoints · bf0b8f4b
      Frederic Weisbecker authored
      
      
      While the tracer accesses ptrace breakpoints, the child task may
      concurrently exit due to a SIGKILL and thus release its breakpoints
      at the same time. We can then dereference some freed pointers.
      
      To fix this, hold a reference on the child breakpoints before
      manipulating them.
      
      Reported-by: default avatarOleg Nesterov <oleg@redhat.com>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Acked-by: default avatarWill Deacon <will.deacon@arm.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Prasad <prasad@linux.vnet.ibm.com>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Link: http://lkml.kernel.org/r/1302284067-7860-5-git-send-email-fweisbec@gmail.com
      bf0b8f4b
    • Frederic Weisbecker's avatar
      powerpc, hw_breakpoints: Fix racy access to ptrace breakpoints · 07fa7a0a
      Frederic Weisbecker authored
      
      
      While the tracer accesses ptrace breakpoints, the child task may
      concurrently exit due to a SIGKILL and thus release its breakpoints
      at the same time. We can then dereference some freed pointers.
      
      To fix this, hold a reference on the child breakpoints before
      manipulating them.
      
      Reported-by: default avatarOleg Nesterov <oleg@redhat.com>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Acked-by: default avatarPrasad <prasad@linux.vnet.ibm.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: v2.6.33.. <stable@kernel.org>
      Link: http://lkml.kernel.org/r/1302284067-7860-4-git-send-email-fweisbec@gmail.com
      07fa7a0a
    • Frederic Weisbecker's avatar
      x86, hw_breakpoints: Fix racy access to ptrace breakpoints · 87dc669b
      Frederic Weisbecker authored
      
      
      While the tracer accesses ptrace breakpoints, the child task may
      concurrently exit due to a SIGKILL and thus release its breakpoints
      at the same time. We can then dereference some freed pointers.
      
      To fix this, hold a reference on the child breakpoints before
      manipulating them.
      
      Reported-by: default avatarOleg Nesterov <oleg@redhat.com>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Prasad <prasad@linux.vnet.ibm.com>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: v2.6.33.. <stable@kernel.org>
      Link: http://lkml.kernel.org/r/1302284067-7860-3-git-send-email-fweisbec@gmail.com
      87dc669b
    • Frederic Weisbecker's avatar
      ptrace: Prepare to fix racy accesses on task breakpoints · bf26c018
      Frederic Weisbecker authored
      
      
      When a task is traced and is in a stopped state, the tracer
      may execute a ptrace request to examine the tracee state and
      get its task struct. Right after, the tracee can be killed
      and thus its breakpoints released.
      This can happen concurrently when the tracer is in the middle
      of reading or modifying these breakpoints, leading to dereferencing
      a freed pointer.
      
      Hence, to prepare the fix, create a generic breakpoint reference
      holding API. When a reference on the breakpoints of a task is
      held, the breakpoints won't be released until the last reference
      is dropped. After that, no more ptrace request on the task's
      breakpoints can be serviced for the tracer.
      
      Reported-by: default avatarOleg Nesterov <oleg@redhat.com>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Prasad <prasad@linux.vnet.ibm.com>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: v2.6.33.. <stable@kernel.org>
      Link: http://lkml.kernel.org/r/1302284067-7860-2-git-send-email-fweisbec@gmail.com
      bf26c018
  2. Apr 22, 2011
    • Peter Zijlstra's avatar
      perf, x86: Update/fix Intel Nehalem cache events · f4929bd3
      Peter Zijlstra authored
      
      
      Change the Nehalem cache events to use retired memory instruction counters
      (similar to Westmere), this greatly improves the provided stats.
      
      Using:
      
      main ()
      {
              int i;
      
              for (i = 0; i < 1000000000; i++) {
                      asm("mov (%%rsp), %%rbx;"
                          "mov %%rbx, (%%rsp);" : : : "rbx");
              }
      }
      
      We find:
      
       $ perf stat --repeat 10 -e instructions:u -e l1-dcache-loads:u -e l1-dcache-stores:u ./loop_1b_loads+stores
        Performance counter stats for './loop_1b_loads+stores' (10 runs):
            4,000,081,056 instructions:u           #      0.000 IPC ( +-   0.000% )
            4,999,502,846 l1-dcache-loads:u          ( +-   0.008% )
            1,000,034,832 l1-dcache-stores:u         ( +-   0.000% )
               1.565184942  seconds time elapsed   ( +-   0.005% )
      
      The 5b is surprising - we'd expect 1b:
      
       $ perf stat --repeat 10 -e instructions:u -e r10b:u -e l1-dcache-stores:u ./loop_1b_loads+stores
        Performance counter stats for './loop_1b_loads+stores' (10 runs):
            4,000,081,054 instructions:u           #      0.000 IPC ( +-   0.000% )
            1,000,021,961 r10b:u                     ( +-   0.000% )
            1,000,030,951 l1-dcache-stores:u         ( +-   0.000% )
               1.565055422  seconds time elapsed   ( +-   0.003% )
      
      Which this patch thus fixes.
      
      Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Lin Ming <ming.m.lin@intel.com>
      Cc: Cyrill Gorcunov <gorcunov@openvz.org>
      Link: http://lkml.kernel.org/n/tip-q9rtru7b7840tws75xzboapv@git.kernel.org
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      f4929bd3
    • Cyrill Gorcunov's avatar
      perf, x86: P4 PMU - Don't forget to clear cpuc->active_mask on overflow · 1ea5a6af
      Cyrill Gorcunov authored
      
      
      It's not enough to simply disable event on overflow the
      cpuc->active_mask should be cleared as well otherwise counter
      may stall in "active" even in real being already disabled (which
      potentially may lead to the situation that user may not use this
      counter further).
      
      Don pointed out that:
      
       " I also noticed this patch fixed some unknown NMIs
         on a P4 when I stressed the box".
      
      Tested-by: default avatarLin Ming <ming.m.lin@intel.com>
      Signed-off-by: default avatarCyrill Gorcunov <gorcunov@openvz.org>
      Acked-by: default avatarDon Zickus <dzickus@redhat.com>
      Signed-off-by: default avatarDon Zickus <dzickus@redhat.com>
      Cc: Cyrill Gorcunov <gorcunov@gmail.com>
      Link: http://lkml.kernel.org/r/1303398203-2918-3-git-send-email-dzickus@redhat.com
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      1ea5a6af
    • Ingo Molnar's avatar
      x86, perf event: Turn off unstructured raw event access to offcore registers · b52c55c6
      Ingo Molnar authored
      Andi Kleen pointed out that the Intel offcore support patches were merged
      without user-space tool support to the functionality:
      
       |
       | The offcore_msr perf kernel code was merged into 2.6.39-rc*, but the
       | user space bits were not. This made it impossible to set the extra mask
       | and actually do the OFFCORE profiling
       |
      
      Andi submitted a preliminary patch for user-space support, as an
      extension to perf's raw event syntax:
      
       |
       | Some raw events -- like the Intel OFFCORE events -- support additional
       | parameters. These can be appended after a ':'.
       |
       | For example on a multi socket Intel Nehalem:
       |
       |    perf stat -e r1b7:20ff -a sleep 1
       |
       | Profile the OFFCORE_RESPONSE.ANY_REQUEST with event mask REMOTE_DRAM_0
       | that measures any access to DRAM on another socket.
       |
      
      But this kind of usability is absolutely unacceptable - users should not
      be expected to type in magic, CPU and model specific incantations to get
      access to useful hardware functionality.
      
      The proper solution is to expose useful offcore functionality via
      generalized events - that way users do not have to care which specific
      CPU model they are using, they can use the conceptual event and not some
      model specific quirky hexa number.
      
      We already have such generalization in place for CPU cache events,
      and it's all very extensible.
      
      "Offcore" events measure general DRAM access patters along various
      parameters. They are particularly useful in NUMA systems.
      
      We want to support them via generalized DRAM events: either as the
      fourth level of cache (after the last-level cache), or as a separate
      generalization category.
      
      That way user-space support would be very obvious, memory access
      profiling could be done via self-explanatory commands like:
      
        perf record -e dram ./myapp
        perf record -e dram-remote ./myapp
      
      ... to measure DRAM accesses or more expensive cross-node NUMA DRAM
      accesses.
      
      These generalized events would work on all CPUs and architectures that
      have comparable PMU features.
      
      ( Note, these are just examples: actual implementation could have more
        sophistication and more parameter - as long as they center around
        similarly simple usecases. )
      
      Now we do not want to revert *all* of the current offcore bits, as they
      are still somewhat useful for generic last-level-cache events, implemented
      in this commit:
      
        e994d7d2: perf: Fix LLC-* events on Intel Nehalem/Westmere
      
      But we definitely do not yet want to expose the unstructured raw events
      to user-space, until better generalization and usability is implemented
      for these hardware event features.
      
      ( Note: after generalization has been implemented raw offcore events can be
        supported as well: there can always be an odd event that is marginally
        useful but not useful enough to generalize. DRAM profiling is definitely
        *not* such a category so generalization must be done first. )
      
      Furthermore, PERF_TYPE_RAW access to these registers was not intended
      to go upstream without proper support - it was a side-effect of the above
      e994d7d2
      
       commit, not mentioned in the changelog.
      
      As v2.6.39 is nearing release we go for the simplest approach: disable
      the PERF_TYPE_RAW offcore hack for now, before it escapes into a released
      kernel and becomes an ABI.
      
      Once proper structure is implemented for these hardware events and users
      are offered usable solutions we can revisit this issue.
      
      Reported-by: default avatarAndi Kleen <ak@linux.intel.com>
      Acked-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Link: http://lkml.kernel.org/r/1302658203-4239-1-git-send-email-andi@firstfloor.org
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      b52c55c6
    • Andi Kleen's avatar
      perf: Support Xeon E7's via the Westmere PMU driver · b2508e82
      Andi Kleen authored
      
      
      There's a new model number public, 47, for Xeon E7 (aka Westmere EX).
      
      Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
      Cc: a.p.zijlstra@chello.nl
      Link: http://lkml.kernel.org/r/1303429715-10202-1-git-send-email-andi@firstfloor.org
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      b2508e82
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block · 91e8549b
      Linus Torvalds authored
      * 'for-linus' of git://git.kernel.dk/linux-2.6-block:
        ide: unexport DISK_EVENT_MEDIA_CHANGE for ide-gd and ide-cd
        block: don't propagate unlisted DISK_EVENTs to userland
        elevator: check for ELEVATOR_INSERT_SORT_MERGE in !elvpriv case too
      91e8549b
    • Tejun Heo's avatar
      ide: unexport DISK_EVENT_MEDIA_CHANGE for ide-gd and ide-cd · 7eec77a1
      Tejun Heo authored
      
      
      check_events() implementations in both ide-gd and ide-cd are
      inadequate for in-kernel event polling.  Both generate media change
      events continuously when certain conditions are met causing infinite
      event loop between the driver and userland event handler.
      
      As disk event now supports suppression of unlisted events, simply
      de-listing DISK_EVENT_MEDIA_CHANGE from disk->events resolves the
      problem.  Internal handling around media revalidation will behave the
      same while userland will fall back to userland event polling after
      detecting the device doesn't support disk events.
      
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Reported-by: default avatarJens Axboe <jaxboe@fusionio.com>
      Acked-by: default avatar"David S. Miller" <davem@davemloft.net>
      Signed-off-by: default avatarJens Axboe <jaxboe@fusionio.com>
      7eec77a1
    • Tejun Heo's avatar
      block: don't propagate unlisted DISK_EVENTs to userland · 7c88a168
      Tejun Heo authored
      
      
      DISK_EVENT_MEDIA_CHANGE is used for both userland visible event and
      internal event for revalidation of removeable devices.  Some legacy
      drivers don't implement proper event detection and continuously
      generate events under certain circumstances.  For example, ide-cd
      generates media changed continuously if there's no media in the drive,
      which can lead to infinite loop of events jumping back and forth
      between the driver and userland event handler.
      
      This patch updates disk event infrastructure such that it never
      propagates events not listed in disk->events to userland.  Those
      events are processed the same for internal purposes but uevent
      generation is suppressed.
      
      This also ensures that userland only gets events which are advertised
      in the @events sysfs node lowering risk of confusion.
      
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatarJens Axboe <jaxboe@fusionio.com>
      7c88a168
    • Jens Axboe's avatar
      elevator: check for ELEVATOR_INSERT_SORT_MERGE in !elvpriv case too · 3aa72873
      Jens Axboe authored
      
      
      The sort insert is the one that goes to the IO scheduler. With
      the SORT_MERGE addition, we could bypass IO scheduler setup
      but still ask the IO scheduler to insert the request. This would
      cause an oops on switching IO schedulers through the sysfs
      interface, unless the disk just happened to be idle while it
      occured.
      
      Signed-off-by: default avatarJens Axboe <jaxboe@fusionio.com>
      3aa72873
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfs · 37fc67c9
      Linus Torvalds authored
      * 'for-linus' of git://oss.sgi.com/xfs/xfs:
        xfs: fix duplicate message output
      37fc67c9
    • Linus Torvalds's avatar
      Merge branch 'x86-fixes-for-linus' of... · d20dc4d5
      Linus Torvalds authored
      Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
      
      * 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
        x86, numa: Fix cpu nodemasks for NUMA emulation and CONFIG_DEBUG_PER_CPU_MAPS
        Revert "x86, NUMA: Fix fakenuma boot failure"
      d20dc4d5
    • Randy Dunlap's avatar
      raid5: fix build error, sector_t usage · d76c8420
      Randy Dunlap authored
      
      
      Change <sectors> from unsigned long long to sector_t.
      This matches its source field.
      
        ERROR: "__udivdi3" [drivers/md/raid456.ko] undefined!
      
      Signed-off-by: default avatarRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      d76c8420
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus · 83425eee
      Linus Torvalds authored
      * git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus:
        virtio: console: Enable call to hvc_remove() on console port remove
        virtio_pci: Prevent double-free of pci regions after device hot-unplug
        virtio: Decrement avail idx on buffer detach
      83425eee
    • Linus Torvalds's avatar
      Merge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6 · 8ed54bd5
      Linus Torvalds authored
      * 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
        agp: fix arbitrary kernel memory writes
        agp: fix OOM and buffer overflow
        drm/radeon/kms: fix IH writeback on r6xx+ on big endian machines
      8ed54bd5
    • Linus Torvalds's avatar
      Merge branch 'drm-intel-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/keithp/linux-2.6 · 25b21037
      Linus Torvalds authored
      * 'drm-intel-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/keithp/linux-2.6:
        drm/i915: Initialise g4x watermarks for disabled pipes
        drm/i915: Sanitize the output registers after resume
        drm/i915/tv: Fix modeset flickering introduced in 7f58aabc
        drm/i915/tv: Only poll for TV connections
        drm/i915/tv: Remember the detected TV type
      25b21037
    • Linus Torvalds's avatar
      Merge git://git.infradead.org/iommu-2.6 · ec616048
      Linus Torvalds authored
      * git://git.infradead.org/iommu-2.6:
        intel_iommu: disable all VT-d PMRs when TXT launched
        intel-iommu: Fix get_domain_for_dev() error path
        intel-iommu: Unlink domain from iommu
        intel-iommu: Fix use after release during device attach
      ec616048
  3. Apr 21, 2011
    • Jan Kara's avatar
      vfs: Pass setxattr(2) flags properly · df7e1303
      Jan Kara authored
      
      
      For some reason generic_setxattr() did not pass flags (XATTR_CREATE,
      XATTR_REPLACE) to the filesystem specific helper. This caused that
      setxattr(2) syscall just ignored these flags.
      
      Fix the bug by passing flags correctly.
      
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      Acked-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      df7e1303
    • Amit Shah's avatar
      virtio: console: Enable call to hvc_remove() on console port remove · afa2689e
      Amit Shah authored
      
      
      This call was disabled as hot-unplugging one virtconsole port led to
      another virtconsole port freezing.
      
      Upon testing it again, this now works, so enable it.
      
      In addition, a bug was found in qemu wherein removing a port of one type
      caused the guest output from another port to stop working.  I doubt it
      was just this bug that caused it (since disabling the hvc_remove() call
      did allow other ports to continue working), but since it's all solved
      now, we're fine with hot-unplugging of virtconsole ports.
      
      Signed-off-by: default avatarAmit Shah <amit.shah@redhat.com>
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      afa2689e
    • Amit Shah's avatar
      virtio_pci: Prevent double-free of pci regions after device hot-unplug · 31a3ddda
      Amit Shah authored
      
      
      In the case where a virtio-console port is in use (opened by a program)
      and a virtio-console device is removed, the port is kept around but all
      the virtio-related state is assumed to be gone.
      
      When the port is finally released (close() called), we call
      device_destroy() on the port's device.  This results in the parent
      device's structures to be freed as well.  This includes the PCI regions
      for the virtio-console PCI device.
      
      Once this is done, however, virtio_pci_release_dev() kicks in, as the
      last ref to the virtio device is now gone, and attempts to do
      
           pci_iounmap(pci_dev, vp_dev->ioaddr);
           pci_release_regions(pci_dev);
           pci_disable_device(pci_dev);
      
      which results in a double-free warning.
      
      Move the code that releases regions, etc., to the virtio_pci_remove()
      function, and all that's now left in release_dev is the final freeing of
      the vp_dev.
      
      Signed-off-by: default avatarAmit Shah <amit.shah@redhat.com>
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      31a3ddda
    • Amit Shah's avatar
      virtio: Decrement avail idx on buffer detach · b3258ff1
      Amit Shah authored
      
      
      When detaching a buffer from a vq, the avail.idx value should be
      decremented as well.
      
      This was noticed by hot-unplugging a virtio console port and then
      plugging in a new one on the same number (re-using the vqs which were
      just 'disowned').  qemu reported
      
         'Guest moved used index from 0 to 256'
      
      when any IO was attempted on the new port.
      
      CC: stable@kernel.org
      Reported-by: default avatarjuzhang <juzhang@redhat.com>
      Signed-off-by: default avatarAmit Shah <amit.shah@redhat.com>
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      b3258ff1
    • Joseph Cihula's avatar
      intel_iommu: disable all VT-d PMRs when TXT launched · 51a63e67
      Joseph Cihula authored
      
      
      Intel VT-d Protected Memory Regions (PMRs) are supposed to be disabled,
      on each VT-d engine, after DMA remapping is enabled on the engines.
      This is because the behavior of having both enabled is not deterministic
      and because, if TXT has been used to launch the kernel, the PMRs may be
      programmed to cover memory regions that will be used for DMA.
      
      Under some circumstances (certain quirks detected, lack of multiple
      devices, etc.), the current code does not set up DMA remapping on some
      VT-d engines.  In such cases it also skips disabling the PMRs.  This
      causes failures when the kernel is launched with TXT (most often this
      occurs on the graphics engine and results in colored vertical bars on
      the display).
      
      This patch detects when the kernel has been launched with TXT and then
      disables the PMRs on all VT-d engines.  In some cases where the reason
      that remapping is not being enabled is due to possible ACPI DMAR table
      errors, the VT-d engine addresses may not be correct and thus not able
      to be safely programmed even to disable PMRs.  Because part of the TXT
      launch process is the verification of these addresses, it will always be
      safe to disable PMRs if the TXT launch has succeeded and hence only
      doing this in such cases.
      
      Signed-off-by: default avatarJoseph Cihula <joseph.cihula@intel.com>
      Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
      51a63e67
    • David Rientjes's avatar
      x86, numa: Fix cpu nodemasks for NUMA emulation and CONFIG_DEBUG_PER_CPU_MAPS · 7a6c6547
      David Rientjes authored
      
      
      The cpu<->node mappings under CONFIG_DEBUG_PER_CPU_MAPS=y
      when NUMA emulation is enabled is currently broken because it does
      not iterate through every emulated node and bind cpus that have
      affinity to it.
      
      NUMA emulation should bind each cpu to every local node to
      accurately represent the true NUMA topology of the underlying
      machine.
      
      debug_cpumask_set_cpu() needs to be fixed at the same time so
      that the debugging information that it emits shows the new
      cpumask of the node being assigned when the cpu is being added
      or removed.
      
      It can now take responsibility of setting or clearing the cpu
      itself to remove the need for duplicate code.
      
      Also change its last parameter, "enable", to have the correct bool
      type since it can only be true or false.
      
       -v2: Fix the return statements, by Kosaki Motohiro
      
      Acked-and-Tested-by: default avatarKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Signed-off-by: default avatarDavid Rientjes <rientjes@google.com>
      Cc: Andreas Herrmann <herrmann.der.user@googlemail.com>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Link: http://lkml.kernel.org/r/alpine.DEB.2.00.1104201918470.12634@chino.kir.corp.google.com
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      7a6c6547
    • David Rientjes's avatar
      Revert "x86, NUMA: Fix fakenuma boot failure" · 37f8527d
      David Rientjes authored
      Andreas Herrmann reported that 7d6b4670
      
       ("x86, NUMA: Fix fakenuma
      boot failure") causes certain physical NUMA topologies (for example
      AMD Magny-Cours) to move sibling cpus to a single node when in reality
      they are in separate domains.
      
      This may result in some nodes being completely void of cpus, which
      doesn't accurately represent the correct topology. The system will
      boot, but will have suboptimal NUMA performance.
      
      This commit was intended as a fix for NUMA emulation, but should
      not cause a regression for real NUMA machines as a side effect.
      
      ( There will be a separate fix for the numa-debug code, which
        will not affect physical topologies. )
      
      Reported-by: default avatarAndreas Herrmann <herrmann.der.user@googlemail.com>
      Signed-off-by: default avatarDavid Rientjes <rientjes@google.com>
      Acked-by: default avatarKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Link: http://lkml.kernel.org/r/alpine.DEB.2.00.1104201918110.12634@chino.kir.corp.google.com
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      37f8527d
    • Vasiliy Kulikov's avatar
      agp: fix arbitrary kernel memory writes · 194b3da8
      Vasiliy Kulikov authored
      
      
      pg_start is copied from userspace on AGPIOC_BIND and AGPIOC_UNBIND ioctl
      cmds of agp_ioctl() and passed to agpioc_bind_wrap().  As said in the
      comment, (pg_start + mem->page_count) may wrap in case of AGPIOC_BIND,
      and it is not checked at all in case of AGPIOC_UNBIND.  As a result, user
      with sufficient privileges (usually "video" group) may generate either
      local DoS or privilege escalation.
      
      Signed-off-by: default avatarVasiliy Kulikov <segoon@openwall.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      194b3da8
    • Vasiliy Kulikov's avatar
      agp: fix OOM and buffer overflow · b522f021
      Vasiliy Kulikov authored
      
      
      page_count is copied from userspace.  agp_allocate_memory() tries to
      check whether this number is too big, but doesn't take into account the
      wrap case.  Also agp_create_user_memory() doesn't check whether
      alloc_size is calculated from num_agp_pages variable without overflow.
      This may lead to allocation of too small buffer with following buffer
      overflow.
      
      Another problem in agp code is not addressed in the patch - kernel memory
      exhaustion (AGPIOC_RESERVE and AGPIOC_ALLOCATE ioctls).  It is not checked
      whether requested pid is a pid of the caller (no check in agpioc_reserve_wrap()).
      Each allocation is limited to 16KB, though, there is no per-process limit.
      This might lead to OOM situation, which is not even solved in case of the
      caller death by OOM killer - the memory is allocated for another (faked) process.
      
      Signed-off-by: default avatarVasiliy Kulikov <segoon@openwall.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      b522f021
    • Linus Torvalds's avatar
      Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/staging · 584f7904
      Linus Torvalds authored
      * 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/staging:
        hwmon: (max34440) Add driver documentation
        hwmon: (max16064) Add driver documentation
        hwmon: (max8688) Add driver documentation
        hwmon: (pmbus) Documentation updates
        hwmon: (smm665) Fix spelling error in driver documentation
        hwmon: (pmbus) Removed unused variable from struct pmbus_data
        hwmon: Add submitting-patches checklist to documentation
      584f7904
    • Linus Torvalds's avatar
      Merge branch 'for-2.6.39' of git://linux-nfs.org/~bfields/linux · 18995ba5
      Linus Torvalds authored
      * 'for-2.6.39' of git://linux-nfs.org/~bfields/linux:
        Open with O_CREAT flag set fails to open existing files on non writable directories
        nfsd4: Fix filp leak
        nfsd4: fix struct file leak on delegation
      18995ba5
    • Linus Torvalds's avatar
      Merge branch 'fixes' of master.kernel.org:/home/rmk/linux-2.6-arm · f3e96492
      Linus Torvalds authored
      * 'fixes' of master.kernel.org:/home/rmk/linux-2.6-arm:
        ARM: 6881/1: cputype.h uses __attribute_const__ which requires including kernel.h
        ARM: Add new syscalls
      f3e96492
    • Linus Torvalds's avatar
      Merge branch 'stable/bug-fixes-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen · 8653b3f1
      Linus Torvalds authored
      * 'stable/bug-fixes-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
        xen: mask_rw_pte: do not apply the early_ioremap checks on x86_32
        xen: do not create the extra e820 region at an addr lower than 4G
      8653b3f1
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://neil.brown.name/md · d0957105
      Linus Torvalds authored
      * 'for-linus' of git://neil.brown.name/md:
        md: Update documentation for sync_min and sync_max entries
        md: Cleanup after raid45->raid0 takeover
        md: Fix dev_sectors on takeover from raid0 to raid4/5
        md/raid5: remove setting of ->queue_lock
      d0957105
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block · 73aa8682
      Linus Torvalds authored
      * 'for-linus' of git://git.kernel.dk/linux-2.6-block:
        block: Remove the extra check in queue_requests_store
        block, blk-sysfs: Fix an err return path in blk_register_queue()
        block: remove stale kerneldoc member from __blk_run_queue()
        block: get rid of QUEUE_FLAG_REENTER
        cfq-iosched: read_lock() does not always imply rcu_read_lock()
        block: kill blk_flush_plug_list() export
      73aa8682
    • Dave Chinner's avatar
      xfs: fix duplicate message output · 3eff1268
      Dave Chinner authored
      Commit 957935dc
      
       ("xfs: fix xfs_debug warnings" broke the logic in
      __xfs_printk(). Instead of only printing one of two possible output
      strings based on whether the fs has a name or not, it outputs both.
      Fix it to only output one message again.
      
      Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarAlex Elder <aelder@sgi.com>
      3eff1268
  4. Apr 20, 2011